How to make Translate function non case sensitive


(Sreejith) #1

I am using a simple translate plugin to mark a device as access switch or not and is working ..But in the list if the device entry is "mnvt542ges02" but the input hostname comes as "MNVT542GES02" it does not match ..Basically how can make the translate non case sensitive ??

Please help

translate {
dictionary_path => "/etc/logstash/switches.csv"
field => "hostname"
destination => "Access_switch"
fallback => "No"
refresh_interval => 86400
}


#2

Make a copy of the field that is lowercase and make the dictionary lowercase

    mutate { copy => { "foo" => "[@metadata][lowerfoo]" } }
    mutate { lowercase => [ "[@metadata][lowerfoo]" ] }
    translate {
      destination => "whichfoo"
      dictionary_path => "/etc/logstash/fooDictionary.csv"
      field => "[@metadata][lowerfoo]"
    }

(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.