Translate filter not working for numbers extracted through Regular Expression


(Hans) #1

Hi, I have difficulties with a filed that I extracted from a long number to lookup with the translate filter.

Here is the initial number:
649032011715511

However I only require the last 5 digits and extract these with the following filter:
grok { match => ["CELL_ID_LONG", "(?<CELL_ID>\d{5})$"] }
Now I get:
15511

This number I now would like to run through the translate filter however it is not returning the value, here is the filter:
translate { field => "Cell_ID" destination => "S_Name" dictionary_path => "/etc/logstash/conf.d/translate/name1.yaml" add_tag => [ "PRESENT" ] }

I have also tried to convert the number to an integer:
mutate { convert => { "CELL_ID" => "integer"} }

This also did not work, the name1.yaml file looks as follows:
... "15511": Ford ...

Could someone kindly assist in trying to identify why the translate filter is not working when using the regular expression to extract the digits and lookup the value?


(Christian Dahlqvist) #2

Here is says Cell_ID with some lower case letters but in other places you refer to it as CELL_ID in all capitals. Which should it be?


(Hans) #3

Thank you very much @Christian_Dahlqvist it is appreciated


(system) #4

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