Ad Widget

Collapse

API auditlog.get endpoint query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kbencze95
    Junior Member
    • Feb 2021
    • 18

    #1

    API auditlog.get endpoint query


    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.
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    Duplicate of https://www.zabbix.com/forum/zabbix-...int-parameters

    Comment

    Working...