10 · Method

Searching lab logs

The search box in the Logs tab searches your lab’s own logs with SPL. The default range, 30 second window, is real-time: new lines appear at the top as they arrive. Pick a Last range to search further back.

The model

Every line a lab service writes is stored as an event with its source (narrow to one with source=<name>), its time and any fields found in it: JSON keys, key=value pairs and access-log columns such as status and path. A search is a filter, then a pipeline: each | hands the events to the next command.

Searches only ever see your session. The search box starts with index=<your storyline>; keep that token in the examples below and replace the placeholder with the storyline already shown in your box. Other indexes are not available here. Leave out session=. Lines arrive within seconds.

From log lines to a tableThe lab's services write log lines. They are stored as events tagged with your session. A search filters those events and pipes them through commands into a table. Lab services write lines Events: your session only filter | stats | table
Illustrative — one session, one search.

Worked example

Checkouts fail. Chart errors by source, then group them, then pull a number out of the text:

index=<your storyline> status>=500 | timechart span=1m count by source
index=<your storyline> error OR timeout | stats count by source
index=<your storyline> * | rex "took=(?<took>\d+)ms" | where took>500 | table _time source took

Groups leave out events that lack the field, so a missing status never shows as an empty row.

Commands worth running

index=<your storyline> status>=500 | head 20

The newest twenty failures, with every field.

index=<your storyline> * | stats count by source

Which service is talking most.

index=<your storyline> * | top limit=5 path

The five commonest values and their share.

Supported here:

New fields: add | table.

Not here: subsearches, join, append, lookup.

Self-check

References

Practise it