Ad Widget

Collapse

Help with jsonpath

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pigi_102
    Member
    • Sep 2021
    • 35

    #1

    Help with jsonpath

    Hi all,
    I'm banging my head to wall as I cannot write a simple jsonpath preprocessing.

    I've gone through jq with success but cannot do it in Zabbix ( 5.4 )

    I've a simple DB Query that return this:
    Code:
    {"INST_ID":"1",
     "RESOURCE_NAME":"processes",
     "CURREN T_UTILIZATION":"76",
     "MAX_UTILIZATION":"99",
     "LIMIT_ VALUE":" 1000",
     "PCT_PROCESS":"7.6"
    }
    I would like to get, say, PCT_PROCESS.

    I've wrote this result in a file and I can do:
    jq .PCT_PROCESS test.json
    and get "7.6", as easy as that.

    I'm not able to mke it work in zabbix.

    The only syntax that did not gave me an error of some kind is:
    $[0]["PCT_PROCESS"] but didn't either gave a value in return.

    I've read almost every thread I've found in this forum and on google, but they all refer to a more complex json wich I can understand.
    For some strange reason I can't figure how to achieve my result.

    Can someone share some light on this, please ?

    Thanks in advance
    Pigi_102
  • Pigi_102
    Member
    • Sep 2021
    • 35

    #2
    I finally found !

    $[0].PCT_PROCESS

    This is the syntax to make it works.

    Thanks anyway for attention.

    Comment

    Working...