Docker Logs Grep
Filter docker compose logs with grep-style context lines, invert and dedupe modes.
Docker Logs Grep
The context counts are like grep -B and -A: matching groups are separated by --, and line numbers use : for a match and - for a context line, the same as grep -n -C.
Filtered output
Learn
History for this tool
The most recent data you entered in this tool, stored only in this browser.
Save what you type here, in this browser? Your work would go into this browser's local storage, so a refresh or a trip to another tool does not wipe it. You also get a short list of previous entries under the form, each one restorable with a click. Nothing is ever uploaded, and there is no account.
Being straight about the trade-off: anything kept there can be read by anyone who can use this browser profile, and by any script that later runs on this site. A tool page can hold a private key, a password or a signed token. Saving is convenient; it is not private.
About this tool
Paste the output of docker compose logs and filter it like grep. Match with context (the equivalent of grep -C, with separate before and after counts), show matching lines only, invert the match, count matches, or list unique matching lines. Context groups are separated by “–” and line numbers use “:” for a match and “-” for context, so the output looks like grep -n -C. Everything runs in the page, so log contents never leave the browser.Questions
- How do I get 10 lines before and 5 lines after a match?
- Leave the grep type on Match with context, set Lines before to 10 and Lines after to 5. That is the same as grep -B 10 -A 5, and grep -C would use the larger of the two.
- What is the difference between Regex and plain search?
- With Regex checked, the pattern is a JavaScript regular expression, so error|timeout matches either word and ^api matches the start of a line. With Regex unchecked every character is literal, so a dot matches only a dot.
- Can I dedupe a noisy log?
- Yes. Use the Unique matching lines type, which behaves like grep … | sort | uniq -c and prefixes each distinct line with how many times it appeared. A pattern of . matches every line, so it can dedupe the whole file.