Iterations of Translate dictionary paths

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:

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?

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 :

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.

Good idea :slight_smile: