When performing a grep like:
$ tail -f apilog_2014.07.09.log | grep "HELLO" | grep "99999"
I get the desired output:
12:22:35 server apache2: HELLO FRIEND 99999
12:22:35 server apache2: HELLO FRIEND 99999
12:22:35 server apache2: HELLO FRIEND 99999
However if I do:
$ tail -f apilog_2014.07.09.log | grep "HELLO FRIEND" | grep "99999"
I don't get anything.
My locale settings are all set to en_US.utf8 and I've tested with [[:space:]] and with \s. No results. The file itself is text/plain; charset=us-ascii (checked with file -bi apilog_2014.07.09.log).
The files themselves are written with rsyslog, if that is any type of hint. Using Ubuntu 12.04.4 LTS.
Is there anything I'm missing?
As requested:
$ grep "HELLO" apilog_2014.07.09.log | od -c
0000000 1 4 : 2 7 : 0 0 s o f i a c
0000020 a r l o s : A P I L O G H
0000040 E L L O F R I E N D t e s t
0000060 i n g \n 1 4 : 3 1 : 4 5 s o f
0000100 i a c a r l o s : A P I L
0000120 O G H E L L O F R I E N D
0000140 t e s t i n g 6 3 9 0 3 \n
0000156
UPDATE 14 Jul 2014
Answer here: Grep with spaces suddenly doesn't work
Related question (same solution): Piping from grep to awk not working