fluentd assumes installed (Reference) http://qiita.com/items/c89b53301a540be72744
Install library
pip install fluent-logger
Modify config
<source>
type forward
port 24224
</source>
<match fluent.test.**>
type stdout
</match>
Start-up
fluentd -c ./fluent/fluent.conf -vv &
python script
#! /usr/local/bin/python
# -*- coding:utf-8 -*-
from fluent import sender
from fluent import event
# params -> *(tag, host, port)
sender.setup('fluent.test', host='localhost', port=24224)
event.Event('follow', {
'from': 'userA',
'to': 'userB'
})
When you run
2013-03-20 11:44:07 +0900 fluent.test.follow: {"to":"userB","from":"userA"}
And output
Recommended Posts