Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to also show lines before and after each matching line #266

Open
duke1995 opened this issue Mar 27, 2021 · 1 comment
Open
Milestone

Comments

@duke1995
Copy link

duke1995 commented Mar 27, 2021

At times when consulting logs, you search for a certain pattern, but you also want to see one or more lines that come just before or after each matching line in the search results, because those lines contain interesting information that may be difficult to match.

For example you may search for lines that contain "ERROR" but also want to see the 2 following lines that may contain the beginning of a stack trace, without seeing the complete stack trace in the search results.
Or you may search for lines that contain "ERROR" and be interested in the info line that comes just before the matching lines.
Or a combination of those, i.e. you'd like to see a given number of lines before and a given number of lines after the matching lines.

grep allows to do this with the -B and -A options (and the -C option but that's just a combination of the other 2 options for convenience): GNU Grep · Invoking grep · Command-line Options · Context Line Control

Being able to do something similar in klogg would be handy, I think.

@duke1995 duke1995 changed the title Allow to also show lines before and after the matching line Allow to also show lines before and after each matching line Mar 27, 2021
@duke1995 duke1995 changed the title Allow to also show lines before and after each matching line Make it possible to also show lines before and after each matching line Mar 28, 2021
@variar variar added this to the 2021.next milestone Mar 30, 2021
@variar
Copy link
Owner

variar commented Mar 30, 2021

Thanks for idea. This has been mentioned several times already. Should be possible to implement together with negative filters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants