Log Grep with Context: Regex Search with Before and After Lines

A grep with context for pasted logs or files: regex, before and after lines, invert, highlight and a match limit.

Use the tool

Why this tool exists

Finding the error line is half the job. The lines before it usually tell you why. This tool shows them with line numbers, the way grep -n -C does.

Matches are marked with a colon and context with a dash. Overlapping context is merged. The output was compared with grep on a test file.

How to use it

  1. Paste the log or choose a file.
  2. Enter a regex and set lines before and after.
  3. Turn on ignore-case, invert or highlight if needed.
  4. Read the matches with context.

Frequently asked questions

Is the syntax grep or JavaScript?

JavaScript regular expressions.

How large a file?

Hundreds of MB may work. For huge files use the large log file viewer.

What does -- mean?

A gap between two groups of context, as in grep.

Is my log uploaded?

No. Everything is processed in your browser and nothing is sent. Logs can hold IP addresses and tokens, so the page does not write them into the address bar.