0

I have a script that output logs every 30 minutes, this logs are appended to a file that store all logs, then I filter the logs that contains 'Maas" string and store those logs to another file.

(script output) | tee -a alldata.log | grep 'Maas' >> filterMaas.log

What I need to do is to add more filters to output to several files, the following line doesnt work, the file filterCCSA.log is empty.

(script output) | tee -a alldata.log | grep 'Maas' >> filterMaas.log | grep 'CCSA' >> filterCCSA.log 

Any idea how can make this work?

1 Answers1

2

You could do something like that:

(script output) | tee >(grep 'Maas' >> filterMaas.log) >(grep 'CCSA' >> filterCCSA.log)  >> alldata.log