Hello,
I am seeking assistance with retrieving information on who disabled a host through the API. Specifically, I'm using the auditlog.get endpoint but encountering issues with the JSON query.
I attempted to use hostname or hostid as a parameter within the search object, but each attempt has resulted in an "Invalid parameter" error. Here's an example of my query:
json
Copy code
{ "jsonrpc": "2.0", "method": "auditlog.get", "params": { "output": "extend", "search": { "host": "asd" }, "sortfield": "clock", "sortorder": "DESC" }, "auth": "xxxxxxxxxxxxxxxxxxxxxxxx", "id": 1 }
And the response I receive is:
json
Copy code
{ "jsonrpc": "2.0", "error": { "code": -32602, "message": "Invalid params.", "data": "Invalid parameter "/search": unexpected parameter "host"." }, "id": 1 }
Unfortunately, the API documentation does not provide details about the search object. Could you please guide me on how to correctly structure my query to use hostname or hostid or a working alternative for this search?
Thank you for your help.
I am seeking assistance with retrieving information on who disabled a host through the API. Specifically, I'm using the auditlog.get endpoint but encountering issues with the JSON query.
I attempted to use hostname or hostid as a parameter within the search object, but each attempt has resulted in an "Invalid parameter" error. Here's an example of my query:
json
Copy code
{ "jsonrpc": "2.0", "method": "auditlog.get", "params": { "output": "extend", "search": { "host": "asd" }, "sortfield": "clock", "sortorder": "DESC" }, "auth": "xxxxxxxxxxxxxxxxxxxxxxxx", "id": 1 }
And the response I receive is:
json
Copy code
{ "jsonrpc": "2.0", "error": { "code": -32602, "message": "Invalid params.", "data": "Invalid parameter "/search": unexpected parameter "host"." }, "id": 1 }
Unfortunately, the API documentation does not provide details about the search object. Could you please guide me on how to correctly structure my query to use hostname or hostid or a working alternative for this search?
Thank you for your help.
Comment