Sha256: fbc803401cfbb132a8ac3f8dd22448dbc9d241a1772d9c00e0a9747e7d540a57

Contents?: true

Size: 1.13 KB

Versions: 7

Compression:

Stored size: 1.13 KB

Contents

require "fluent/plugin/filter"
require "fluent/plugin/parse_request_body_extractor"

module Fluent::Plugin
  class ParseRequestBodyFilter < Fluent::Plugin::Filter

    Fluent::Plugin.register_filter('parse_request_body', self)

    desc "point a key whose value contains URL string."
    config_param :key,    :string
    desc "If set, only the key/value whose key is included only will be added to the record."
    config_param :only,   :string, default: nil
    desc "If set, the key/value whose key is included except will NOT be added to the record."
    config_param :except, :string, default: nil
    desc "If set to true, the original key url will be discarded from the record."
    config_param :discard_key, :bool, default: false
    desc "Prefix of fields."
    config_param :add_field_prefix, :string, default: nil
    desc "If set to true, permit blank key."
    config_param :permit_blank_key, :bool, default: false

    def configure(conf)
      super
      @extractor = Fluent::Plugin::ParseRequestBodyExtractor.new(self, conf)
    end

    def filter(tag, time, record)
      @extractor.add_query_params_field(record)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fluent-plugin-parse_request_body-0.0.7 lib/fluent/plugin/filter_parse_request_body.rb
fluent-plugin-parse_request_body-0.0.6 lib/fluent/plugin/filter_parse_request_body.rb
fluent-plugin-parse_request_body-0.0.5 lib/fluent/plugin/filter_parse_request_body.rb
fluent-plugin-parse_request_body-0.0.4 lib/fluent/plugin/filter_parse_request_body.rb
fluent-plugin-parse_request_body-0.0.3 lib/fluent/plugin/filter_parse_request_body.rb
fluent-plugin-parse_request_body-0.0.2 lib/fluent/plugin/filter_parse_request_body.rb
fluent-plugin-parse_request_body-0.0.1 lib/fluent/plugin/filter_parse_request_body.rb