Hi

I need to parse the following JSON array:

[{"Tilstand":"Slukket "},{"Alarm":"Ingen"}]

...but I'm getting the error: Data at the root level is invalid. Line 1, position 1.

The data is valid JSON according to the online validators...

I need to parse the key "Alarm" to get the value "Ingen".

Is this currently possible?


Article Comments

Dear Lars,

presuming you want to do this with the HTTP/XML Rest-Sensor, which is able to check JSON, the JSON needs to start with { and end }. So it needs to be like

{
"Tilstand":"Slukket ",
"Alarm":"Ingen"
}

or

{ 
"my_array": 
[{"Tilstand":"Slukket "},{"Alarm":"Ingen"}]
}

Feb, 2012 - Permalink

This seems broken. It is perfectly valid JSON to start with an array at the root level. We currently cannot monitor RabbitMQ as a result of this prtg issue.


Sep, 2012 - Permalink