So, I want to monitor live logs as they come with less +F, but the logs have a LOT of noise before the actual message - fortunately the line is segmented by | character, with the timestamp being before the first | and the message being after last |

I know it is possible to search with regexes with less - but can you s///g every line and then [-1] element as one would in for eg Perl?

Or maybe there is some completely different way to do it, not using less?

1 Answer 1


You can pre-process the logs before feeding them to less:

tail -F /path/to/logfile | grep -o '[^|]*$' | less
  • alas, doesnt work - results in an empty screen but its a cool idea, perhaps i can work on this
    – Maciej
    Commented May 18, 2021 at 14:16
  • The filal less screws up.
    – vonbrand
    Commented May 20, 2021 at 13:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .