# Translate filter not working for numbers extracted through Regular Expression

**URL:** https://discuss.elastic.co/t/translate-filter-not-working-for-numbers-extracted-through-regular-expression/66623
**Category:** Logstash
**Created:** [November 19, 2016, 2:26pm UTC](https://discuss.elastic.co/t/translate-filter-not-working-for-numbers-extracted-through-regular-expression/66623 "2016-11-19T14:26:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Hans](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@Hans](https://discuss.elastic.co/u/Hans)
#### Post date: [November 19, 2016, 2:26pm UTC](https://discuss.elastic.co/t/translate-filter-not-working-for-numbers-extracted-through-regular-expression/66623/1 "2016-11-19T14:26:29Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 19, 2016, 2:59pm UTC](https://discuss.elastic.co/t/translate-filter-not-working-for-numbers-extracted-through-regular-expression/66623/2 "2016-11-19T14:59:27Z")

</div>

> [@Hans](#):
>
> field =\> "Cell\_ID"

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?

---

<div class="post-metadata">

### Author: ![Hans](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@Hans](https://discuss.elastic.co/u/Hans)
#### Post date: [November 19, 2016, 3:22pm UTC](https://discuss.elastic.co/t/translate-filter-not-working-for-numbers-extracted-through-regular-expression/66623/3 "2016-11-19T15:22:57Z")

</div>

Thank you very much @Christian_Dahlqvist it is appreciated

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 17, 2016, 3:23pm UTC](https://discuss.elastic.co/t/translate-filter-not-working-for-numbers-extracted-through-regular-expression/66623/4 "2016-12-17T15:23:23Z")

</div>

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