# Translate plugin does not populate destination if it already exists

**URL:** <https://discuss.elastic.co/t/translate-plugin-does-not-populate-destination-if-it-already-exists/153433>\
**Category:** Logstash\
**Created:** [October 22, 2018, 3:26pm UTC](https://discuss.elastic.co/t/translate-plugin-does-not-populate-destination-if-it-already-exists/153433 "2018-10-22T15:26:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![parosio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/parosio/32/27367_2.png) [@parosio](https://discuss.elastic.co/u/parosio)\
**Post date:** [October 22, 2018, 3:26pm UTC](https://discuss.elastic.co/t/translate-plugin-does-not-populate-destination-if-it-already-exists/153433/1 "2018-10-22T15:26:25Z")

</div>

Hello,

I think I've found a rather weird behavior of translate plugin (logstash 5.4).

I'm looking for a match in a first dictionary; if no match is found, I need to use a second dictionary.  
The second translation only works if I remove the destination field (as in the example below).

Could someone check if this is correct, or if I've overlooked something?

```
  filter { 
     . . . 
    translate {
    field => "Source_Ip"
    destination => "src_translation"
    exact => true
    fallback => "not_found"
    dictionary_path => "${DICTS}/first_dict.yml"
  }
  if ( [src_translation] =~ /not_found/ ) {
     # it only works removing destination field
    mutate {remove_field => ["src_translation"]}
    translate {
      field => "Source_Ip"
      destination => "src_translation"
      exact => true
      fallback => "not_found"
      dictionary_path => "${DICTS}/second_dict.yml"
    }
  }
 . . . }
```

---

<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:** [November 19, 2018, 3:26pm UTC](https://discuss.elastic.co/t/translate-plugin-does-not-populate-destination-if-it-already-exists/153433/2 "2018-11-19T15:26:28Z")

</div>

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