On this page
Source Summaries
Roll a source's events up on a schedule and keep the totals for longer than the raw events.
A summary is a scheduled | stats query over one data source. Each run
reads one window of the source's events and saves every result row back into
the source as a new event. Summary rows are kept for their own retention, so
you can keep a year of hourly error counts while the raw events age out after
a week.
Add a summary
Open a data source and find the Summaries section on its page, then choose Add summary:
- Name - every row the summary writes carries it in its
summaryfield. - Query - a filter and one
| stats, for examplelevel=error | stats count() AS errors by service. It starts assource_id="<this source>" | stats count(), an event count per window. - Run every - 5 minutes, 15 minutes, 1 hour, 6 hours or 1 day. Each run covers exactly that window, aligned to UTC, so daily runs start at midnight UTC. This cannot change once the summary is saved.
- Keep rows for - 30, 90, 180 or 365 days, 90 by default, separate from the source's raw retention.
- Start from - summarise earlier windows from the raw events still kept, or start from now.
Every kind of source can have summaries. An AWS CloudWatch connection collects each log group as its own input, so you pick the log group a summary reads.
Only members whose role sees all of the workspace's data can add or change a summary, because it runs over every event of its source.
What a query can do
A summary reads its own source only. It cannot use | timechart (the window
is the bucket), | inputlookup, or a filter on signal. The editor says why
when it refuses a query. Use Test in Explorer beside the query to try it
over one window first.
Everything else works as it does in a search, including | json and
| lookup. Two things are worth knowing because each window runs on its own:
| jsonreads each window's own events, so the fields a summary writes can change as your events do. Name and type the paths, such as| json field=message duration_ms:number, to keep them the same.- A summary row keeps a lookup table's values from when its window ran. To have
old rows follow later edits to the table, put the
| lookupin the query that reads the summary instead.
One window can write up to 5,000 rows. Past that, the run keeps 5,000 and says it was truncated; group by fewer fields to stay under it.
Read the results
Summary rows are ordinary events, so the Explorer, dashboards and alerts all
work with them. A search over a source returns its raw events only, so
adding a summary never changes an existing count. Add signal=summary to
read summaries instead:
source_id="<this source>" signal=summary summary="errors_by_service"
| timechart span=1d sum(errors) by service
Each row carries the query's output columns under the names you gave them,
plus summary, summary_id, summary_span and summary_window_end. Its
timestamp is the start of its window. Each summary's Explore button opens
its rows.
Runs, pauses and failures
A window runs a couple of minutes after it ends, to let late events arrive. No window is skipped or written twice, including after an outage: missed windows are caught up oldest first. Pausing stops the runs, and resuming starts again from the current window, so the paused period stays a gap.
When a summary's latest run fails, the managed Summary failing alert emails everyone in the workspace. Configure it under Summary alerts, linked from the Summaries section.
Deleting a summary stops it, and optionally deletes the rows it has written. Removing the source removes its summaries.