Ad Widget

Collapse

API - Search or Filter on query Data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zubalea
    Junior Member
    • Mar 2017
    • 1

    #1

    API - Search or Filter on query Data

    API Call:

    {
    "jsonrpc": "2.0",
    "method": "item.get",
    "params": {
    "output": "extend",
    "hostids": "10084",
    "search": {
    "name": "Testing"
    },
    "selectItemDiscovery": "extend"
    },
    "auth": "hidden",
    "id": 1
    }

    Result (summary)
    {
    "itemid": "23718",
    "hostid": "10084",
    "name": "Testing",
    "itemDiscovery": {
    "itemdiscoveryid": "247",
    "itemid": "23718",
    "parent_itemid": "23280",
    "key_": "Testing"
    },
    }


    I would like to either filter or search the value in itemDiscovery->itemid

    In the API call I can use successfully either:

    "search"={"name": "Test"}
    or
    "filter"={"name": "Testing"}

    But I have not figured out the syntax to find items within a subset like itemDiscovery.

    I tried and failed using:
    search={"itemDiscovery.itemid": "23718"}

    Is there a way to search or filter on data within a subset like itemDiscovery?

    Note:
    I know that many other API calls exist for specific subset. I am just looking for the proper syntax, if any, to search or filter subsets of data.

    Thank you
    Z
  • SimpleRezo
    Junior Member
    • Sep 2020
    • 19

    #2
    Hi

    Old thread, but without any answer...
    Having the same question, i'm trying a UP

    Regards

    Comment

    Working...