# My translate plugin doesn't seem to work with a dictionary file

**URL:** <https://discuss.elastic.co/t/my-translate-plugin-doesnt-seem-to-work-with-a-dictionary-file/49359>\
**Category:** Logstash\
**Created:** [May 6, 2016, 1:08am UTC](https://discuss.elastic.co/t/my-translate-plugin-doesnt-seem-to-work-with-a-dictionary-file/49359 "2016-05-06T01:08:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lask001](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@lask001](https://discuss.elastic.co/u/lask001)\
**Post date:** [May 6, 2016, 1:08am UTC](https://discuss.elastic.co/t/my-translate-plugin-doesnt-seem-to-work-with-a-dictionary-file/49359/1 "2016-05-06T01:08:00Z")

</div>

I can't explain why this doesn't work, and it's really irking me, hoping someone could take a look and help me out.

```
        mutate {
		add_field => ["dictionary_lookup", "%{host} %{sitename}"]
		}
		
	translate {
		field => "dictionary_lookup"
		destination => "sc_sitename"			
		#dictionary => ["Server W3SVC2","Logstash"]
		dictionary_path => "E:/ELK/logstash/dictionaries/dictionary.yaml"
		}

```

My .yaml file is in the proper location, and contains a single line containing:

```
"Server W3SVC2": "Logstash"

```

When I flip my comment from dictionary to dictionary\_path, the code works instantly. My field dictionary lookup contains the value "Server W3SVC2" and the translation occurs, storing the name Logstash in the sc\_sitename column. Can anyone tell what I'm doing wrong with the dictionary\_path that's causing this to fail? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [May 6, 2016, 2:16pm UTC](https://discuss.elastic.co/t/my-translate-plugin-doesnt-seem-to-work-with-a-dictionary-file/49359/2 "2016-05-06T14:16:26Z")

</div>

If you launch logstash with `--debug` do you see some output or errors from the translate filter?

If the filter was not able to find a file logstash would refuse to start.  
What is the encoding of the yaml file? utf8?

On macos with a simple configuration file and when I type "Server W3SVC" it correctly create the field.

```auto
input {
  stdin {}
}
filter {
  translate {
    field => "message"
    destination => "Hola"
    dictionary_path => "/tmp/translate.yml"
  }
}

output {
  stdout { codec => rubydebug {} }
}

```

And the following translate.yml

```auto
"Server W3SVC2": "Logstash"

```

---

<div class="post-metadata">

**Author:** ![lask001](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@lask001](https://discuss.elastic.co/u/lask001)\
**Post date:** [May 7, 2016, 12:45am UTC](https://discuss.elastic.co/t/my-translate-plugin-doesnt-seem-to-work-with-a-dictionary-file/49359/3 "2016-05-07T00:45:55Z")

</div>

It ended up being the encoding of the file. I was using notepad++ to edit my yaml file and it was adding tabs, spaces, or something that I couldn't see. When I changed to sublime it worked right away. Thanks for the suggestion on starting in debug, I will try that next time I run into an error.

---

<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:** [July 6, 2017, 4:58am UTC](https://discuss.elastic.co/t/my-translate-plugin-doesnt-seem-to-work-with-a-dictionary-file/49359/4 "2017-07-06T04:58:57Z")

</div>


