Logstash if statement check in file


(musa) #1

hi guys,

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

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


(Magnus B├Ąck) #2

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


(musa) #3

thank you for quick reply. i will try that.


(musa) #4

it works very well. thank you so much.


(musa) #5

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:


(system) #6

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