Hi,
I would like to get help on applying stats on the following JSON data:
{
"ts":1527498793267,
"version":"1.12.7",
"data":{
"myList":[
{
"id":"180528_090203",
"nativeRequestReceived":1,
"nativeResponseSent":1
},
{
"id":"180528_090129",
"nativeRequestReceived":1,
"nativeResponseSent":1
}
],
"freemem":6534152192
},
"time":"2018-05-28T09:13:13.267Z",
"v":0
}
I started writing the query as written below, but it doesn't give desired result. split function is grouping same values of nativeResponseSent and nativeRequestReceived together.
input data | rename data.myList{}.* as * | eval mvfield=mvzip($id$,mvzip($nativeResponseSent$,$nativeRequestReceived$)) | fields mvfield | mvexpand mvfield | eval mvfield=split(mvfield,",") | eval id=mvindex(mvfield,0) | eval nativeResponseSent=mvindex(mvfield,1) | eval nativeRequestReceived=mvindex(mvfield,2) | stats sum(nativeResponseSent) sum(nativeRequestReceived) by id
... View more