Skip to main content

scout logs

Query logs for a specific service from the Scout platform. Filter by severity, body content, attributes, and more.

scout logs demo

Usage

scout logs <SERVICE> [flags]

Arguments

ArgumentTypeDescription
SERVICEstring(required) Service name to query logs for

Flags

FlagTypeDefaultDescription
--severitystringSeverity levels, comma-delimited. Repeatable. Values: INFO, WARN, ERROR, DEBUG, FATAL
--containsstringFilter by body substring (case-insensitive)
--attrKEY=VALUEFilter by log attribute. Repeatable (AND logic)
--resourceKEY=VALUEFilter by resource attribute. Repeatable (AND logic)
--trace-idstringFilter by trace ID
--sinceduration5mTime window (max: 15 minutes). Conflicts with --start
--startRFC 3339Start time. Conflicts with --since
--endRFC 3339End time. Requires --start
--limitinteger100Maximum number of results (max: 1000)
--rawboolfalseOutput JSON
--body-onlyboolfalseOutput only log bodies, one per line. Conflicts with --raw
--discoverboolfalseShow available log metadata instead of querying
--wideboolfalseShow full log bodies without truncation

Examples

Query recent logs for a service:

scout logs payment-service

Filter by severity:

scout logs payment-service --severity ERROR,WARN

Search log bodies:

scout logs payment-service --contains "timeout" --since 10m

Filter by attributes:

scout logs payment-service --attr user_id=123 --resource environment=prod

Correlate with a trace:

scout logs payment-service --trace-id abc123def456

Output only log bodies:

scout logs payment-service --body-only

Discover available metadata:

scout logs payment-service --discover

Attribute Filtering

Use --attr and --resource to filter by key-value pairs. Multiple filters of the same type use AND logic.

# Both conditions must match
scout logs payment-service --attr user_id=123 --attr action=checkout
tip

Use --discover to see available attribute keys and severity values before building a targeted query.

warning

The maximum time range is 15 minutes. For longer queries, use --start and --end with explicit timestamps.

See Also

  • traces — query distributed traces
  • metrics — query service metrics
  • alerts — query alert history
Was this page helpful?