Skip to main content

Query server logs with filters

POST 

/api/v4/logs/query

Query server logs using filter criteria. If another cluster node's logs can't be fetched (for example, it doesn't respond in time), the request still succeeds and that node's array contains a single entry with level set to error, msg set to Failed to fetch logs from node, failed_node set to true, and an error field describing the failure. This entry is returned regardless of log_levels, date_from and date_to.

Permissions Must have get_logs permission.​

Request​

Responses​

Log query successful. The response maps each node name to its log entries. In a licensed, enabled cluster, node names are the cluster hostnames (or default for this node if its cluster name is unavailable); otherwise the server's logs are returned under default. Every node that was queried is included, with an empty array if it has no matching entries. A node the cluster has already marked as failed isn't queried and is omitted.