Re:Show HN: Tailspin – A Log File Highlighter
by CubsFan1060 on Thursday November 02, 2023 @08:24AM
(#38112523)
Try
| less -p ".jpg"
Re:Show HN: Tailspin – A Log File Highlighter
by svedin on Thursday November 02, 2023 @09:01AM
(#38112903)
ripgrep has a --passthru flag that does exactly this
tail -f access.log | rg --passthru '\.jpg'
Re:Show HN: Tailspin – A Log File Highlighter
by philo23 on Thursday November 02, 2023 @09:23AM
(#38113170)
Brilliant, this looks like exactly what I want. I already use ripgrep a lot, so I should have guessed it had this feature already but wouldn't have known what to search for to find it! Thank you
Re:Show HN: Tailspin – A Log File Highlighter
by jpitz on Thursday November 02, 2023 @03:19PM
(#38118625)
As does ack
Re:Show HN: Tailspin – A Log File Highlighter
by zem on Friday November 03, 2023 @01:46AM
(#38124992)
I have that aliased to `hl` in my bashrc
Re:Show HN: Tailspin – A Log File Highlighter
by loudmax on Thursday November 02, 2023 @09:11AM
(#38113041)
This is how I colorize with grep:
cat <file> | grep -E --color "<regex>|$"
Where `<regex>` is your pattern.
Re:Show HN: Tailspin – A Log File Highlighter
by ralgozino on Thursday November 02, 2023 @09:28AM
(#38113233)
adding "or an end of the line" to the regex is pretty clever, I'm stealing it :)
thanks!
Re:Show HN: Tailspin – A Log File Highlighter
by quickthrower2 on Friday November 03, 2023 @04:47AM
(#38126071)
Obligatory “you don’t need cat”
Re:Show HN: Tailspin – A Log File Highlighter
by jstanley on Thursday November 02, 2023 @09:35AM
(#38113320)
I wrote this years ago: https://github.com/jes/emph
I’ve not found anything like that yet though, closest I’ve come is using grep with the before/after/context flag with a high number of lines or using search in less, but I want to do something like...
Maybe I’ve just not found the right flag for grep yet...