Use fluentd from python

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

Use fluentd from python
Use MySQL from Python
Use MySQL from Python
Use BigQuery from python.
Use mecab-ipadic-neologd from python
Use MySQL from Anaconda (python)
Use e-Stat API from Python
Use Stanford Core NLP from Python
Read and use Python files from Python
Forcibly use Google Translate from python
Use kabu Station® API from Python
Use Azure Blob Storage from Python
Use the Flickr API from Python
Use fastText trained model from Python
Use Google Analytics API from Python
sql from python
MeCab from Python
Use PostgreSQL data type (jsonb) from Python
Use machine learning APIs A3RT from Python
I want to use jar from python
Use Google Cloud Vision API from Python
Use Django from a local Python script
Use C ++ functions from python with pybind11
Touch MySQL from Python 3
Use config.ini in Python
Operate Filemaker from Python
[Python] Use JSON with Python
Firebase: Use Cloud Firestore and Cloud Storage from Python
Use dates in Python
Access bitcoind from python
Changes from Python 3.0 to Python 3.5
Changes from Python 2 to Python 3.0
Study from Python Hour7: How to use classes
Python from or import
Use Valgrind in Python
Use mecab with Python3
Use LiquidTap Python Client ③
Run python from excel
Install python from source
Use DynamoDB with Python
[Bash] Use here-documents to get python power from bash
Wrap C with Cython for use from Python
Execute command from Python
Operate neutron from Python!
Use Python 3.8 with Anaconda
Use Python in your environment from Win Automation
[Python] format methodical use
Use python with docker
I want to use ceres solver from python
Operate LXC from Python
Use LiquidTap Python Client ②
Manipulate riak from python
Force Python from Fortran
Use profiler in Python
Let's use different versions of SQLite3 from Python3!
Execute command from python
Wrap C ++ with Cython for use from Python
Use the nghttp2 Python module from Homebrew from pyenv's Python
[Python] Read From Stdin
Use Tor to connect from urllib2 [Python] [Mac]
Python: Use zipfile to unzip from standard input