Class: LogStash::Filters::Urldecode

Inherits:
Base show all
Defined in:
lib/logstash/filters/urldecode.rb

Overview

The urldecode filter is for decoding fields that are urlencoded.

Constant Summary

Constants inherited from Base

Base::RESERVED

Constants included from Config::Mixin

Config::Mixin::CONFIGSORT

Instance Attribute Summary

Attributes included from Config::Mixin

#config, #original_params

Attributes inherited from Plugin

#logger, #params

Instance Method Summary collapse

Methods inherited from Base

#execute, #initialize, #threadsafe?

Methods included from Config::Mixin

#config_init, included

Methods inherited from Plugin

#eql?, #finished, #finished?, #hash, #initialize, #inspect, lookup, #reload, #running?, #shutdown, #teardown, #terminating?, #to_s

Constructor Details

This class inherits a constructor from LogStash::Filters::Base

Instance Method Details

#filter(event) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/logstash/filters/urldecode.rb', line 23

def filter(event)
  return unless filter?(event)

  # If all_fields is true then try to decode them all
  if @all_fields
    event.to_hash.each do |name, value|
      event[name] = urldecode(value)
    end
  # Else decode the specified field
  else
    event[@field] = urldecode(event[@field])
  end
  filter_matched(event)
end

#registerObject



18
19
20
# File 'lib/logstash/filters/urldecode.rb', line 18

def register
  # Nothing to do
end