Created
September 29, 2011 16:54
-
-
Save ksauzz/1251259 to your computer and use it in GitHub Desktop.
fluent input plugin sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<source> | |
type xxxx | |
host 192.168.x.x | |
port 1999 | |
</source> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Fluent | |
class XXXXInput < Input | |
# pluginの登録 | |
Fluent::Plugin.register_input('xxxx', self) | |
def initialize | |
super | |
# 初期化処理 | |
end | |
def configure(conf) | |
super | |
# 設定ファイルの情報をconfから取得してpluginにセットする | |
@host = conf.has_key?('host') ? conf['host'] : 'localhost' | |
@port = conf.has_key?('port') ? conf['port'] : 9999 | |
end | |
def start | |
super | |
# fluent起動後のデータ取得処理。 | |
..... | |
# tag, time, recodeを取得してbufferへ渡す | |
Engine.emit(@tag, Fluent::Event.new(time, record)) | |
end | |
def shutdown | |
super | |
# リソースの解放などの終了処理 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment