I am trying to extract a particular line from a.log which keeps appending every sec and output that into a newfile b.log which should append itself with filtered data received from a.log
I tried
tail -f a.log |grep fail| tee -a b.log
nothing in b.log
tail -f a.log |grep fail >>b.log
nothin shows up in b.log
what am i missing?
Is there an option similar to tail -f with awk?
"tail -f" command shows just last 10 lines and it keeps on refreshing...
Can you show us output of "tail -f a.log | grep fail" ?
It would be helpout to give a suggesion...
tail -f just displays the realtime appended output of the file...not just the 10lines
anyways i figured out a way using awk..but would gr8 if we can do it using grep
[FONT=Courier New]wannalearn,
Would this work for you:
while true
do
egrep 'fail' a.log > b.log
sleep 1
done
sami98
April 10, 2007, 5:22pm
5
if u r using linux, u could try:
watch -n 1 'egrep fail a.log > b.log'