Quantcast
Channel: User olo - Server Fault
Viewing all articles
Browse latest Browse all 2

Linux cli pipeline command tail and grep

$
0
0

I am using tail to monitor a log file and using grep to filer the keyword.

tail -F somefile.log | grep "keyword" is workingtail -F somefile.log | awk '{print $4}' is working

but if to put them together is not working, like tail -F somefile.log | grep "keyword" | awk '{print $4}'

Is this the wrong way to use |? How to make tail -F somefile.log | grep "keyword" | awk '{print $4}' to work? Thanks

if I want to run a command after awk like tail -F somefile.log | grep "keyword" | awk '{print $4}' | ./abashfile.sh how to achieve something like this, looks like multiple | is not quite right for combining everything in 1 line. Thanks


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>