Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Tail -f | grep > output.txt

$
0
0
hi guys,

I perform a sort of monitoring. I have a server running and with
Code:

tail -f | grep "Searchstring"
I monitor the log-file for recent specific entries. This is ok and works fine.

Now, in addition I want to have my search results not posted into the shell but into a file. I tried:
Code:

tail -f | grep "Searchstring" > output.txt
Code:

tail -f | grep "Searchstring" >> output.txt
Code:

tail -f  > output.txt
works but has no "grep" statement.

Would be very nice if you could help me out.
thx in advance

Viewing all articles
Browse latest Browse all 16232

Trending Articles