Hello!
I have an item that is collecting the result from an API. The result is a JSON, like this:
{"service1" : { "healthy" : true, "yyy" : "xxx" }, "service2" : { "healthy" : true}, "service3" : { "healthy" : true} (...) }
To monitor it, I need to count how many "true" it's returning, so in the final, if I have 5 "true's" I know that everything is ok. I'm with some troubles to do it... I tried calculated items and used this expression: > count(general.value,"true"), and "general.value" is the key of my main item, the one that is collecting the response from API, but unsuccessfully. I've read the manual, but I didn't understand it very well, so I know that I'm doing something wrong.
This is the best way to do this type of count? and what I'm doing wrong?
I have an item that is collecting the result from an API. The result is a JSON, like this:
{"service1" : { "healthy" : true, "yyy" : "xxx" }, "service2" : { "healthy" : true}, "service3" : { "healthy" : true} (...) }
To monitor it, I need to count how many "true" it's returning, so in the final, if I have 5 "true's" I know that everything is ok. I'm with some troubles to do it... I tried calculated items and used this expression: > count(general.value,"true"), and "general.value" is the key of my main item, the one that is collecting the response from API, but unsuccessfully. I've read the manual, but I didn't understand it very well, so I know that I'm doing something wrong.
This is the best way to do this type of count? and what I'm doing wrong?
Comment