Please believe me 🙂 that I have searched for an answer until my index finger bled (pun intended, but seriously...I have searched).
I have the JSON (below) already indexed. (Re-indexing is a very last resort.) The fields appear as:
testId, results{}.*, and results{}.steps{}.\
I need one event per result with the following fields:
testId, runId, startTime, result, name
The runId value is unique within results{}. The name value is unique within results{}.steps{} (and the names are repeated with each run, ie "CASE1", ..., "CASE9")
I understand the basics of mvzip and mvexpand. I'm open to a different approach if possible because (1) I can't get it to work with multiple levels and (2) there are actually 14 other fields not shown below, which are spread through each level.
Is using crazy long mvzip and eval commands my only option? If so, how does it work with multiple levels?
Thanks!
Sample JSON
{
"testId": "perfScenario1",
"results": [
{
"runId": "GUID1",
"steps": [
{
"startTime": "2018-01-20T00:00:00.000Z",
"result": "1.3",
"name": "CASE1"
},
{
"startTime": "2018-01-20T00:02:00.000Z",
"result": "0.2",
"name": "CASE2"
},
...
]
},
{
"runId": "GUID2",
"steps": [
{
"startTime": "2018-01-20T06:00:00.000Z",
"result": "1.3",
"name": "CASE1"
},
{
"startTime": "2018-01-20T06:00:00.000Z",
"result": "0.2",
"name": "CASE2"
},
...
]
},
...
]
}
... View more