Ad Widget

Collapse

Couldn't extract value with JSONPath.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • greendruid
    Junior Member
    • Feb 2018
    • 4

    #1

    Couldn't extract value with JSONPath.

    Hi!

    I try to extract value of `ValueCSV` from the next construction:

    ```
    {
    "MetricName": "net.multicastRx.summation",
    "MetricInstance": "-",
    "ValueCSV": "7",
    "Units": "num"
    },
    ```
    (this is the array with unique values of 'MetricName')
    I'm use the next sequence: `$.VMMetrics[?(@.MetricName == "net.packetsTx.summation")].ValueCSV`, but Zabbix show an exclamation.
    Does anyone faced with similar parsing tasks?

    Thanks!
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    In the JSON where the value of MetricName is exemplified, it is “net.multicastRx.summation”, but the value of MetricName specified in JSONPath is “net.packetsTx.summation”. It doesn't match, but make sure that the record you want to get is included in the JSON.

    And what version of Zabbix is used? Is it 4.2.5 or later? Or Is it 4.0.11 or later?

    ZBXNEXT-4502 : Support of 'advanced' JSON Path expressions

    Comment

    Working...