class Fluent::Plugin::SqlFingerprintFilter

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method
# File lib/fluent/plugin/filter_sql_fingerprint.rb, line 12
def configure(conf)
  super
end
filter(tag, time, record) click to toggle source
# File lib/fluent/plugin/filter_sql_fingerprint.rb, line 24
def filter(tag, time, record)
  sql = hash_get(record, @target_key)
  if !sql.nil? && !sql.empty?
    record[@added_key] = fingerprint(sql)
  end
  record
end
fingerprint(sql) click to toggle source
# File lib/fluent/plugin/filter_sql_fingerprint.rb, line 32
def fingerprint(sql)
  unless sql.empty?
    o, s = Open3.capture2(@fingerprint_tool_path, :stdin_data => sql)
    if s.success?
      o.chomp!
      sql = o unless o.empty? 
    end
  end
  sql
end
hash_get(hash, key) click to toggle source
# File lib/fluent/plugin/filter_sql_fingerprint.rb, line 43
def hash_get(hash, key)
  return hash[key.to_sym] if hash.key?(key.to_sym)
  return hash[key] if hash.key?(key)
  nil
end
shutdown() click to toggle source
Calls superclass method
# File lib/fluent/plugin/filter_sql_fingerprint.rb, line 20
def shutdown
  super
end
start() click to toggle source
Calls superclass method
# File lib/fluent/plugin/filter_sql_fingerprint.rb, line 16
def start
  super
end