Logstash if statement check in file

hi guys,

can i check a value in a file with if statement ?

such as if [host ] in "./hostlist.txt"

Not exactly like that, but perhaps the translate filter can help you?

thank you for quick reply. i will try that.

it works very well. thank you so much.

translate
{
field => "host"
dictionary_path => "/etc/logstash/hosts/3rd_Party.yaml"
add_tag => "DC_3rd_Party"
}

it is my configuration.

3rd_Party.yaml like that

IPADDRESS : HOSTNAME

i hope it will help other guys :slight_smile:

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