From zabbix API documentation:
Get methods output parameter
Output can be “shorten”, “refer”, “extend” and array of db field names.
-shorten: only ids of elements are returned. (for hosts it's hostid, for items itemid etc)
-refer: element ids are returned with element ids that were used in query.
For example request item.get(output: refer, hostids: [1,2,3])) will return items with itemids and hostids.
-extend: all db fields of element are returned (select *)
-array of db fields: listed db fields are returned
What is the correct format to pass an array of db fields? I have tried the following:
but this only returns the itemids
or is there a different way to filter the returned fields?
Get methods output parameter
Output can be “shorten”, “refer”, “extend” and array of db field names.
-shorten: only ids of elements are returned. (for hosts it's hostid, for items itemid etc)
-refer: element ids are returned with element ids that were used in query.
For example request item.get(output: refer, hostids: [1,2,3])) will return items with itemids and hostids.
-extend: all db fields of element are returned (select *)
-array of db fields: listed db fields are returned
What is the correct format to pass an array of db fields? I have tried the following:
Code:
{ "id":"1", "method":"item.get", "params": { "search":{"description":"Comp."}, "seachWildcardsEnabled":"1", "output":["lastvalue","lastclock","host"] }, "jsonrpc":"2.0", "auth":"045fe742cf405bb83281bff2567b1eef" }
Code:
{ "jsonrpc":"2.0", "result":[ {"itemid":"22319"}, {"itemid":"22318"}, {"itemid":"22328"}, {"itemid":"22330"}, {"itemid":"22332"}, {"itemid":"22334"}, {"itemid":"22336"}, {"itemid":"22338"}, {"itemid":"22324"}, {"itemid":"22326"}, {"itemid":"22325"}, {"itemid":"22327"}, {"itemid":"22329"}, {"itemid":"22331"}, {"itemid":"22333"}, {"itemid":"22335"}, {"itemid":"22337"}, {"itemid":"22339"}], "id":"1" }
Comment