class Fluent::DataRejecterOutput

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_data_rejecter.rb, line 9
def configure(conf)
    super
    @remove = @remove_prefix.end_with?('.') ? @remove_prefix : @remove_prefix + '.'
    @add    = @add_prefix.end_with?('.')    ? @add_prefix    : @add_prefix    + '.'
    @add_p  = @add.chop
end
emit(tag, es, chain) click to toggle source
# File lib/fluent/plugin/out_data_rejecter.rb, line 16
def emit(tag, es, chain)
    tmptag = (tag[@remove.size .. -1] if tag.start_with?(@remove)) || (tag == @remove_prefix ? '' : tag)
    tag    = @add_p.size.zero? ? (tmptag.size.zero? ? "data_rejecter.tag_lost" : tmptag) : (tmptag.size.zero? ? @add_p : @add + tmptag)

    es.each {| time, record |
        Engine.emit(tag, time, reject_record(record))
    }
    chain.next
end

Private Instance Methods

reject_record(record) click to toggle source
# File lib/fluent/plugin/out_data_rejecter.rb, line 27
def reject_record(record)
    @reject_keys.split.each{| v | record.delete(v) if record.has_key?(v)}
    record
end