I have JSON data which are multivalued. I want to create a overview table of the counts. {
"suite": [
{
"hostname": "localhost",
"failures": 0,
"packa...
See more...
I have JSON data which are multivalued. I want to create a overview table of the counts. {
"suite": [
{
"hostname": "localhost",
"failures": 0,
"package": "ABC",
"tests": 0,
"name": "ABC_test",
"id": 0,
"time": 0,
"errors": 0,
"testcase": [
{
"classname": "xyz",
"name": "foo1",
"time": 0,
"status": "Passed"
},
{
"classname": "pqr",
"name": "foo2",
"time": 0,
"status": "Passed"
},
.
.
.
]
}
]
} This is the data. For a given project there'll be many JSON files like above. So i want to get the unique data while taking the counts. Tried with mvdedup, it did not work. |spath output=jenkins_url path=JenkinsMetaData.JENKINS_URL
| spath output=suite path=suite{}.name
| spath output=case path=suite{}.case{}.name
| spath output=Build_Num path=JenkinsMetaData.buildnumber
| spath output=Status path=suite{}.case{}.status
| fields - _raw
| eventstats max(Build_Num) as Latest_Build by Job_Name
| where Latest_Build=Build_Num
| stats values(Build_Num) as Build_Num
count(eval(Status="Execution Failed" OR Status="Testcase_Failed"))
AS Failed_cases,
count(eval(Status="Passed")) AS Passed_cases,
count(eval(Status="Failed" OR Status="Testcase_Error")) AS Execution_Failed_cases,
dc(case) as Total_cases
dc(suite) as "Total suite"
by Job_Name Build_Variant Jenkins_Server When i do this Total_cases and Total suite are are correct, but other values are not correct. But when i use |Status="Passed"| stats dc(case) as Passed_cases for one project, im getting correct value. But my requirement is to create a table for all the projects. Anyone know how to handle this?