Skip to content

Instantly share code, notes, and snippets.

@yteraoka
Last active December 12, 2015 02:09
Show Gist options
  • Save yteraoka/4696897 to your computer and use it in GitHub Desktop.
Save yteraoka/4696897 to your computer and use it in GitHub Desktop.
fluent-agent-lite のように正規表現なしで行をそのまま一つのキーに突っ込んで取り込む fluentd plugin
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