aws_logs_tail
Retrieve recent CloudWatch Logs events from a log group as JSON, using the same time parsing as the AWS CLI. Supports filter patterns and time windows.
Instructions
Tail CloudWatch Logs for a log group. Wraps 'aws logs tail' (not the raw FilterLogEvents API) so you get the same server-side time parsing and event-grouping the CLI uses. Returns recent events as JSON. Does NOT stream -- run once to fetch the window, then call again with a later since. For long windows (> a few hundred events), narrow via filterPattern or lower since.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logGroupName | Yes | Log group name, e.g. '/aws/lambda/my-fn' or '/aws/ecs/my-service'. No leading 'logs/'. | |
| since | No | Window to tail: '<number><s|m|h|d|w>'. Default '10m'. Example: '30m', '1h', '3d'. | |
| filterPattern | No | CloudWatch Logs filter pattern. E.g. 'ERROR', '"stack trace"', '[timestamp, request_id, level = ERROR, ...]'. | |
| logStreamNames | No | Restrict to specific stream names. Overrides the default (all streams in the group). | |
| logStreamNamePrefix | No | Restrict to streams with this prefix. Mutually exclusive with logStreamNames. | |
| profile | No | Override session profile for this call. | |
| region | No | Override session region for this call. | |
| timeoutMs | No | Timeout in milliseconds. Default 60000 (60s). Raise for large windows. |