Filter, search and pause
LogLens has two ways to find lines. A filter hides every line that does not match, and keeps doing so as new lines arrive. A search leaves the view as it is and jumps between matching lines, highlighting them. Both use regular expressions.
Good to know
A regular expression (regex) is a text pattern. Plain words work as they are: timeout matches any line containing "timeout". Special characters add rules: 5\d\d matches 500 to 599, and error|fail matches either word. Matching is case-sensitive, so add (?i) at the start, as in (?i)error, to ignore case. LogLens uses Python's regex syntax.
Filter the view
Press /. The filter box opens at the bottom. If a filter is already on, its pattern is filled in so you can edit it.
Type a pattern. The view updates with every key you press.
Press Enter to keep the filter and close the box. The status bar shows the pattern between slashes, for example
/POST/.
To remove the filter, press Esc while nothing else is open, or open the box with / and delete the text.
The filter matches against the original log line, not the coloured label or time that LogLens adds in front of it. To show one file only, filter on something that only appears in that file's lines.
When the pattern is not valid
While you type, a pattern can be briefly invalid, for example [0-9 before you type the closing ]. LogLens then marks the box's border, shows invalid regex in the status bar, and keeps the last valid filter in place. Finish or fix the pattern and the view updates again.
Show errors only
Press e. Only lines with the ERROR level stay visible, and the status bar shows ERRORS. Press e again to turn it off.
Traceback lines belong to the error above them, so they stay visible too. LogLens treats a line as part of the previous record when it is indented, or starts with Traceback (most recent call last), File or at . See how levels are found for each format.
You can combine errors-only with a filter. A line is shown only when it passes both.
Pause the tail
Press p to freeze the view. PAUSED appears in the status bar. LogLens keeps reading the files in the background; it only stops scrolling, so you can read and scroll with ↑, ↓, PgUp and PgDn. The view holds the newest 1,000 lines that pass your filters; to reach older lines, use search.
Press p again to resume. The view jumps to the newest lines, and any active search is cleared.
Search the buffer
Search looks through every line LogLens still holds (up to 100,000), not only the lines on screen.
Press s. The search box opens: search buffer — Enter jumps, Esc cancels.
Type a pattern and press Enter.
LogLens pauses (if it was not paused already), jumps to the newest matching line, highlights every match in yellow and shows the current line in bold.
Read the status bar:
?timeout? match 12/12means the patterntimeouthas 12 matches and you are on number 12, the newest. Matches are counted from the oldest.Press n for the next older match and N for the next newer one. Both wrap around at the ends.
Search only finds lines that the current filter and errors-only setting let through. If you see no matches and expected some, clear the filter first.
To clear the search, press Esc (with the search box closed) or press p to resume the live tail. An invalid search pattern shows invalid search regex and keeps the box open so you can fix it.