Ad Widget

Collapse

How to filter via API Triggers ID according to the expression in the trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andyway85
    Junior Member
    • Oct 2021
    • 20

    #1

    How to filter via API Triggers ID according to the expression in the trigger

    Hi,

    I've been working with Zabbix API and it's really great to automate configurations, however i'm stucked on getting a trigger id trying to filter it by the expression configured on the trigger

    Code:
    json={
        "jsonrpc": "2.0",
        "method": "trigger.get",
        "params": {
            "output": ["triggerid"],
            "filter": {
                   "expression": "max(/Device1/icmpping,#3)=0"
                   }
             },
        "id": 1,
        "auth": token
    })

    I get no result from this query, but the expression on the trigger is exactly written as the one on the field expression, i've tryied with "key_" instead of "expression" but then the results are all the triggers and not just the one that says max(/Device1/icmpping,#3)=0

    Any suggestions

    Thank you!
    Last edited by andyway85; 12-01-2022, 22:54.
  • SimpleRezo
    Junior Member
    • Sep 2020
    • 19

    #2
    I had the same issue and have figured out why it's not working : that's because expression filter/search is made on "unexpanded" expression format.

    I tried to add expandExpression flag, but even with it, filter/search is still made on unexpanded format.

    Comment

    Working...