Ad Widget

Collapse

Zabbix JsonPath LLD problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Krevedka
    Junior Member
    • Jul 2019
    • 17

    #1

    Zabbix JsonPath LLD problems

    Hi team!
    Via API i collect JSON:

    Code:
    [
    [
    {
    "metric": {
    "name": "manager",
    "endpoint": "ep1-2x"
    },
    "value": [
    "1"
    ]
    },
    {
    "metric": {
    "name": "consult",
    "endpoint": "ep1-2x"
    },
    "value": [
    "1"
    ]
    }
    ]
    ]
    in https://jsonpath.com/ this string works correct
    $[?(@.metric.name == 'manager',@.metric.endpoint== 'ep1-2x')].value

    in zabbix preprocessing on LLD item prototype $[?(@.metric.name == '{#MANAGER}',@.metric.endpoint== '{#ENDPOINT}')].value
    does not working

    How can i create items with {#MANAGER}_{#ENDPOINT} in name and key, and get value to this item from $[?(@.metric.name == '{#MANAGER}',@.metric.endpoint== '{#ENDPOINT}')].value?
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Did you set LLD macros? It has to know, where to find values for specific macro. "{#MANAGER} ->$.metric.name" and "{#ENDPOINT -> $.metric.endpoint" or similar (I always struggle with those jsonpaths.. )

    Comment

    Working...