get_surrounding_messages
Retrieve log messages contextual to a target message using its ID or timestamp. See surrounding events to understand the sequence of actions.
Instructions
Get messages surrounding a specific message. Provide messageId (preferred) or messageTimestamp to identify the target message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of messages to return. Default: 50 | |
| query | No | Additional query filter to narrow context | |
| fields | No | Comma-separated field names to return, or '*' for all fields. Default: returns key fields only (timestamp, gl2_message_id, source, env, level, message, logger_name, thread_name, PODNAME) | |
| filters | No | Field filters (e.g. {"env": "marketplace_loki", "level": 7}) | |
| messageId | No | gl2_message_id of the target message (preferred). The timestamp will be looked up automatically. | |
| streamIds | No | Optional stream IDs to scope the search. Use 'list_streams' to get available stream IDs. | |
| exactMatch | No | If true (default), wraps the query in quotes for exact match. Set to false for fuzzy/wildcard search. | |
| messageTimestamp | No | ISO timestamp of the target message (fallback if messageId is not available) | |
| surroundingSeconds | No | Time window in seconds (± around the timestamp). Default: 5 |