Sha256: 16c38ec552c7bd41232438ddea5fdf192df01ccaf0e2abac815ca835c6d5c73d
Contents?: true
Size: 1.04 KB
Versions: 1
Compression:
Stored size: 1.04 KB
Contents
require 'fluent/plugin/in_http' require_relative 'logplex' module Fluent class HerokuSyslogHttpInput < HttpInput Plugin.register_input('heroku_syslog_http', self) include Logplex config_param :format, :string, :default => SYSLOG_REGEXP config_param :drain_ids, :array, :default => nil private def parse_params_with_parser(params) if content = params[EVENT_RECORD_PARAMETER] records = [] messages = content.split("\n") messages.each do |msg| @parser.parse(msg) { |time, record| raise "Received event is not #{@format}: #{content}" if record.nil? record["time"] ||= time parse_logplex(record, params) unless @drain_ids.nil? || @drain_ids.include?(record['drain_id']) log.warn "drain_id not match: #{msg.inspect}" next end records << record } end return nil, records else raise "'#{EVENT_RECORD_PARAMETER}' parameter is required" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fluent-plugin-heroku-syslog-0.1.0 | lib/fluent/plugin/in_heroku_syslog_http.rb |