Last active
December 12, 2015 02:09
-
-
Save yteraoka/4696897 to your computer and use it in GitHub Desktop.
fluent-agent-lite のように正規表現なしで行をそのまま一つのキーに突っ込んで取り込む fluentd plugin
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 AsisTailInput < TailInput | |
Plugin.register_input('tailasis', self) | |
def initialize | |
super | |
@parser = nil | |
end | |
def configure_parser(conf) | |
@parser = AsisParser.new | |
@parser.configure(conf) | |
end | |
end | |
class AsisParser | |
include Configurable | |
config_param :asis_key, :string, :default => 'message' | |
def parse(text) | |
record = {} | |
record[@asis_key] = text | |
return Engine.now, record | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment