Merge two Json arrays in logstash+ruby

Hello ,

I want to merge two json array based on one id matching fields and create an new array in logstash , I have two Json array data1,data2 below -

"data1 "{
"tenant":"0",
"city":"FLORENCE",
"id":"AXY798",
"state":"KY",
},
{
"tenant":"1",
"city":"FLORENCE2",
"id":"AXX123",
"state":"KY",
}
"data2 "{
"org":"teda",
"id":"AXY798",
"role":"Contact"
},
{
"org":"partition",
"id":"AXX123",
"role":"Shared"
}

Based on matching "id" , need to create a result json array:

"result "{
"tenant":"0",
"city":"FLORENCE",
"id":"AXY798",
"state":"KY",
"role":"Contact",
"org":"teda",
},
{
"tenant":"1",
"city":"FLORENCE2",
"id":"AXX123",
"state":"KY",
"org":"partition",
"role":"Shared"
}

How to achieve this in logstash ..pls suggest

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