Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tail -F log.log | grep ResponseTime | cut -d = -f 2

Tags:

bash

unix

pipe

I have a live log file called log.log and want to catch some matching patterns and values in it:

Example: log.log is growing and we are searching for lines that have pattern "ResponseTime = VALUE" and we want to extract the matched VALUE:

I am executing:

tail -F log.log | grep ResponseTime | cut -d = -f 2 | tr -d " "

And I am expecting to see

VALUE1
VALUE2
.. etc

But it is not working ... what should I do?

Thank you, NaMo

===========

Thank you, it works now. I am using: inotail -f log.log | stdbuf -oL grep ResponseTime | stdbuf -oL cut -d '=' -f 2 | stdbuf -oL tr -d " "

like image 769
NaMo Avatar asked Dec 14 '25 12:12

NaMo


1 Answers

BASH FAQ entry #9: "What is buffering? Or, why does my command line produce no output: tail -f logfile | grep 'foo bar' | awk ..."

like image 98
Ignacio Vazquez-Abrams Avatar answered Dec 18 '25 07:12

Ignacio Vazquez-Abrams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!