I have a JSON file with the following format:
"Checks": {
"Price": {
"Category": "Critical",
"Classification": "Mandatory",
"Value": {
"Unit": "Percent",
"Value": 15.0
}
},
"Time": {
"Category": "NotSpecified",
"Classification": "General",
"Value": {
"Min": {
"Unit": "Seconds",
"Value": -10
},
"Max": {
"Unit": "Seconds",
"Value": 10
}
}
},
So essentially I have an object called 'Checks', which contains a bunch of different rules (Price, Time etc in the above example). Each rule has a Category, a Classification and a Value, which is ultimately what I'm interested in displaying in a panel.
I would like some advice on the best way of searching this JSON data so that I can do the following:
Browse all the rules by their Category and/or their classification
Extract the details from the 'Value' object
For example, if I wanted to show only the 'Critical' checks from above I would like to display:
Category Classification RuleName Value Unit
Critical Mandatory Price 15.0 Percent
I have read the SPATH documentation but I don't really see how I can extract the Category, Classification and Value without explicitly stating the rule name. For example, I suspect I need something like this:
spath Checks.*.Category
... View more