class Fluent::Plugin::JqTransformerFilter

Public Instance Methods

filter(tag, time, record) click to toggle source
# File lib/fluent/plugin/filter_jq_transformer.rb, line 29
def filter(tag, time, record)
  new_record = jq_transform tag: tag, time: time, record: record
  return new_record if new_record.is_a?(Hash)

  log.error "jq filter #{@jq} did not return a hash, skip this record."
  nil
rescue JqError
  log.error "Filter failed with #{@jq}#{log.on_debug { ' on ' + MultiJson.dump(tag: tag, time: time, record: record) }}, error: #{$!.message}"
  nil
end