# Iterations of Translate dictionary paths

**URL:** https://discuss.elastic.co/t/iterations-of-translate-dictionary-paths/49322
**Category:** Logstash
**Created:** [May 5, 2016, 4:34pm UTC](https://discuss.elastic.co/t/iterations-of-translate-dictionary-paths/49322 "2016-05-05T16:34:13Z")
**Posts on this page:** 5
**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 5, 2016, 4:34pm UTC](https://discuss.elastic.co/t/iterations-of-translate-dictionary-paths/49322/1 "2016-05-05T16:34:13Z")

</div>

Hi - I am trying to create a dynamic dictionary\_path for the translate function that will allow me to import IIS sitename values. As it stands right now, I have the following filter working:

translate{  
dictionary\_path =\> "E:/ELK/logstash/dictionaries/server01.yaml"  
field =\> "sitename"  
destination =\> "sc\_sitename"  
}

This works perfectly and gives me what I want, for the server01. The issue is the IIS logs sitename starts from 1 on each server, so the output of the field sitename is duplicated many times. What I want is to have the translate function dynamically use a .yaml file based on what the servers host name is.

What I've tried is something like:

dictionary\_path =\> "E:/ELK/logstash/dictionaries/%{host}.yaml"

But that's causes the filter to break and the application to stop working. Can anyone point me in the right direction on how to get the functionality I'm looking for to work, without hard coding every possible combination?

---

<div class="post-metadata">

### Author: ![fbaligand](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fbaligand/32/5657_2.png) [@fbaligand](https://discuss.elastic.co/u/fbaligand)
#### Post date: [May 5, 2016, 5:21pm UTC](https://discuss.elastic.co/t/iterations-of-translate-dictionary-paths/49322/2 "2016-05-05T17:21:26Z")

</div>

I'm sorry but I don't think "dictionnary\_path" option support patterns like %{host}.

If you need this enhancement, I advice you to open an issue on plugin github repository :

> **[logstash-plugins/logstash-filter-translate](https://github.com/logstash-plugins/logstash-filter-translate/issues)**
>
> logstash-filter-translate - Translate filter for 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 5, 2016, 5:27pm UTC](https://discuss.elastic.co/t/iterations-of-translate-dictionary-paths/49322/3 "2016-05-05T17:27:34Z")

</div>

Thanks for the response, I found a workaround, which was adjusting my dictionary file to have the server hostname as part of the lookup value, and creating an additional field to search on.

---

<div class="post-metadata">

### Author: ![fbaligand](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fbaligand/32/5657_2.png) [@fbaligand](https://discuss.elastic.co/u/fbaligand)
#### Post date: [May 5, 2016, 5:35pm UTC](https://discuss.elastic.co/t/iterations-of-translate-dictionary-paths/49322/4 "2016-05-05T17:35:20Z")

</div>

Good idea 🙂

---

<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:59am UTC](https://discuss.elastic.co/t/iterations-of-translate-dictionary-paths/49322/5 "2017-07-06T04:59:12Z")

</div>


