Ad Widget

Collapse

Failed: cannot extract value from json by path

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tomga
    Junior Member
    • Sep 2016
    • 6

    #1

    Failed: cannot extract value from json by path

    Hi,

    perhaps someone could give me a hint.

    Trying to extract a value from this json source

    {
    "Body" : {
    "Data" : {
    "DAY_ENERGY" : {
    "Unit" : "Wh",
    "Value" : 735.70000000000005
    },
    "DeviceStatus" : {
    "ErrorCode" : 307,
    "StatusCode" : 3
    },
    "TOTAL_ENERGY" : {
    "Unit" : "Wh",
    "Value" : 4398
    },
    "YEAR_ENERGY" : {
    "Unit" : "Wh",
    "Value" : 4398.3999999999996
    }
    }
    },
    "Head" : {
    "RequestArguments" : {
    "DataCollection" : "CommonInverterData",
    "DeviceClass" : "Inverter"
    },
    "Status" : {
    "Code" : 0
    },
    "Timestamp" : "2021-12-12T22:19:48+01:00"
    }
    }

    but always getting this error message

    Preprocessing failed for: {. "Body" : {. "Data" : {. "DAY_ENERGY" : {. "Unit" : "Wh",. ...
    1. Failed: cannot extract value from json by path "$.": jsonpath was unexpectedly terminated"

    1) I created a http agent with fetches the json data. The history data of that item looks good.
    2) Next I created a dependent item with a JsonPath preprocessing parameters $.Body.Data.DAY_ENERGY.Value
    3) The test with the history data works fine.

    Any ideas or a bug?
    I'm running zabbix 6.0.0 alpha7
  • tomga
    Junior Member
    • Sep 2016
    • 6

    #2
    (Nevermind, error was gone with the update to zabbix-server 6.0.0. beta1)

    Seems to be related to the zabbix-proxy.
    Changes in the preprocessing are not transferred directly. After restarting the proxy new values are transferred directly.
    Last edited by tomga; 14-12-2021, 22:32.

    Comment

    Working...