Edited as per first response… does this make it easier?
Consider the following JSON (made up and simplified version of actual responses)
{
"numItems": 2,
"items": [
{
"name":"Item 1",
"notWanted": true,
"Interesting Data 1":"Interesting Text",
"Interesting Data 2":"More Interesting Text",
"UnInteresting Data":"Not So Interesting Text"
},
{
"name":"Item 2",
"Interesting Data 1":"Interesting Text",
"Interesting Data 2":"More Interesting Text",
"UnInteresting Data":"Not So Interesting Text"
}
]
}
Using multiscrape (or REST as suggested below), I want to extract to a single sensor the number of items (easy), but then add a single attribute that lists Items but ONLY where the item does not contain the key ‘NotWanted’.
From the example above, I would therefore only want Item 2 as it does not contain the key NotWanted.
I also only want to capture the key values for some of the keys. See ‘Interesting Data x’ in example…
I’m at a loss as to where to start to only extract the items that don’t contain a specific key or how to only extract the key:value pairs I want.
Thanks for any pointers