Query Syslog
query_syslogRetrieve ServiceNow system log entries to identify errors, warnings, and debug output. Monitor script executions and deployment issues with filters for level, source, and custom queries, sorted newest-first.
Instructions
Query the ServiceNow system log (syslog) to check for errors, warnings, and debug output. Returns log entries with timestamps, levels, sources, and messages. Results are ordered newest-first.
Useful for monitoring script execution results, checking for errors after deployments, and debugging issues. Can be called repeatedly to check for new entries. Use the 'syslog' table for system-level logs and 'syslog_app_scope' for scoped application logs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | Filter by log level. Only returns entries at the specified level. | |
| limit | No | Maximum number of syslog entries to return. Default is 50. | |
| query | No | A ServiceNow encoded query string for additional filtering. Example: "messageLIKEscript error^source=sys_script". This is combined with any level/source filters specified below. | |
| table | No | Which syslog table to query. Use "syslog" for the main system log, or "syslog_app_scope" for scoped application logs which include the application scope field. | syslog |
| source | No | Filter by log source (e.g., "sys_script", "workflow"). Exact match. | |
| instance | No | The ServiceNow instance auth alias (e.g., "myinstance", "prod"). If not provided, falls back to the SN_AUTH_ALIAS environment variable. |