New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Parse JSON Array

Votes:

0

Your Vote:

Up

Down

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?

json parse sensor

Created on Feb 26, 2012 8:05:08 PM by  Lars Meldgård (0) 1



2 Replies

Votes:

0

Your Vote:

Up

Down

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"}]
}

Created on Feb 27, 2012 2:30:57 PM by  Torsten Lindner [Paessler Support]



Votes:

0

Your Vote:

Up

Down

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.

Created on Sep 26, 2012 2:59:06 PM by  duckworth (0)



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.