Ad Widget

Collapse

Help on inquiry of items with filters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gduchate
    Junior Member
    • Feb 2020
    • 7

    #1

    Help on inquiry of items with filters

    Hello

    I am trying to run a simple item.get to obtain records filtering by name, however the following request does not filter the records based on the provided name. The host and application provided filters correctly but the filter based on name is not working, any help is really appreciated


    {
    "params": {
    "host": "Centos",
    "application": "CPU",
    "filter": [
    {
    "name": "CPU guest time"
    }
    ]
    },
    "id": 1685528505,
    "jsonrpc": "2.0",
    "method": "item.get",
    "auth": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    Does it work if you use "output": "extend" as part of the params?

    See the documentation for the "common get parameters", https://www.zabbix.com/documentation...nce_commentary

    Comment

    • gduchate
      Junior Member
      • Feb 2020
      • 7

      #3
      I tried with output extend but still does it does not filter. I used the following request. I can see the item with this name, but the result brings many more items with different names.

      {
      "params": {
      "host": "Centos",
      "filter": [
      {
      "name": "CPU guest time"
      }
      ],
      "output": "extend"
      },
      "id": 1288284342,
      "jsonrpc": "2.0",
      "method": "item.get"
      }

      Comment

      • gduchate
        Junior Member
        • Feb 2020
        • 7

        #4
        According to the documentation for text search the "Search" option should be used including a couple of switches. I ended with the following request but still does not filter according with the "name" field.

        {
        "params": {
        "host": "Centos",
        "output": "extend",
        "search": [
        {
        "name": [
        "CPU idle time"
        ]
        }
        ],
        "searchByAny": true,
        "startSearch": true
        },
        "id": 753726490,
        "jsonrpc": "2.0",
        "method": "item.get",
        "auth": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        }

        Comment

        Working...