I have a multiline message field,
"CPU=9% TotalMem=12288 MB FreeMem=3895 MB AMQMemoryPercentUsage=0%
n0-kkk size=0 inFlight=0 enqRate=0 deqRate=0
n1-xxx size=1 inFlight=1 enqRate=13 deqRate=2
n2-yyyy-oo size=11 inFlight=4 enqRate=3 deqRate=21
I have mutated it by splitting on new line and now i can access msg ....
msg -> CPU=9% TotalMem=12288 MB FreeMem=3895 MB AMQMemoryPercentUsage=0%
msg -> n0-kkk size=11 inFlight=3 enqRate=22 deqRate=22
msg -> n1-xxx size=12 inFlight=4 enqRate=4 deqRate=7
I want to have a for loop on this 'msg' array from array index 1 to n, so i don't have to hard code the index and read each value in this loop. I want to read each array item e.g.
n0-kkk size=11 inFlight=3 enqRate=22 deqRate=22
and process it further like break the first word and label it as 'queue-name',
and i want to load all array item in a list of map.
It tried to us kv filter but it combine all values from same field in an array like
size = 11,12,...
whereas i want to get each array entry as a map
queue-name : " n0-kkk"
size : 11
which logstash filter i can use and how? I am new to ruby so tried a couple of things but i m not getting desired results.