I have tried all possible case but unable to match data between API and CSV file. my ultimate goal is read host key from REST API and matching with CSV file and print respective OS. Please suggest, Configuration as below -
input{
http{
host => "*****"
port => "****"
type => "api_input"
}
file {
path => "/etc/logstash/conf.d/Event.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
skip_header => "true"
columns => ["server", "os"]
}
if [server] == [result][host] {
mutate { add_field => { "OS_Name" => "%{[os]}" } }
}
else{drop {}}
}
output {
stdout {
codec => rubydebug
}
}
csv file data :- server_1,Windows server_2,Linux server_3,Unix server_4,Windows
API data :- {"result":[{"host":"server_4","parameter":"22"}]}