I have created two array in logstash..which code are given below:
filter{
ruby {
code => '
event['ids'] = [1100,1101,1102,1103,1104]
event['value'] = ["apple","dell","mi","lenovo","nokia"]
if event[ids][i] == 1100
{
mutate { replace => { event["ids"] => values[i] } }
}
end
'
}
}
I created two array ids and values and comparing if any ids value with 1100 then it replace with corresponding value like 1100 replace with apple.
Kindly tell me correct way..