-
Problem report
-
Resolution: Unresolved
-
Trivial
-
None
-
6.0.19, 6.4.3, 6.4.4
-
None
Hello!
According to documentation (https://www.zabbix.com/documentation/current/en/manual/api/reference_commentary#common-get-method-parameters)
| search | object | Return results that match the given pattern (case-insensitive). Accepts an array, where the keys are property names, and the values are strings to search for. If no additional options are given, this will perform a LIKE "%…%" search. Works only for string and text fields. |
I'm try to search items with this request:
{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": [
"itemid",
"key_",
"name",
"units"
],
"hostids": "10584",
"search": {
"key_": [
"icmpping",
"common.health"
]
}
},
"id": 1,
"auth": "token"
}
and get empty response:
{
"jsonrpc": "2.0",
"result": [],
"id": 1
}
But if I add ("searchByAny": true), then I got answer what I want, but with more items (like if searchWildcardsEnabled=true)
{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": [
"itemid",
"key_",
"name",
"units"
],
"hostids": "10584",
"search": {
"key_": [
"icmpping",
"common.health"
]
},
"searchByAny": true
},
"id": 1,
"auth": "token"
}
Seems simple array of items is not working properly.