grafana-prtg
grafana-prtg copied to clipboard
How to parse the various columns in a table?
trafficstars
When the query comes back from PRTG with several columns such as "Traffic In (speed)" and "Traffic In (volume)" how do you choose what you'd like on the graph. The query builder shows this:

But in the "channel" field, I can't select which data to grab. The XML that comes back looks like this:
<item>
<datetime>5/27/2018 9:50:09 AM</datetime>
<datetime_raw>43247.7014933796</datetime_raw>
<value channel=\"Traffic Total (volume)\" channelid=\"-1\">17,452 KByte</value>
<value_raw channel=\"Traffic Total (volume)\" channelid=\"-1\">17870481.0000</value_raw>
<value channel=\"Traffic Total (speed)\" channelid=\"-1\">4.76 Mbit/s</value>
<value_raw channel=\"Traffic Total (speed)\" channelid=\"-1\">595484.2053</value_raw>
<value channel=\"Traffic In (volume)\" channelid=\"0\">16,514 KByte</value>
<value_raw channel=\"Traffic In (volume)\" channelid=\"0\">16910236.0000</value_raw>
<value channel=\"Traffic In (speed)\" channelid=\"0\">4.51 Mbit/s</value>
<value_raw channel=\"Traffic In (speed)\" channelid=\"0\">563486.7044</value_raw>
<value channel=\"Traffic Out (volume)\" channelid=\"1\">938 KByte</value>
<value_raw channel=\"Traffic Out (volume)\" channelid=\"1\">960245.0000</value_raw>
<value channel=\"Traffic Out (speed)\" channelid=\"1\">0.26 Mbit/s</value>
<value_raw channel=\"Traffic Out (speed)\" channelid=\"1\">31997.5008</value_raw>
<coverage>100 %</coverage>
<coverage_raw>0000010000</coverage_raw>
</item>
I am trying to get the data in the "speed" field in this particular instance. But in other instances I would want the volume. How can you differentiate these in the request?
Thanks.
Sal
Have you tried an application of regex with this?