I want to monitor 2 different log files (at the time events appear in logs).
tail -f /var/log/file1 -f /var/log/file2  
For each file, I want to grep some patterns:
tail -f /var/log/file1 | grep '\(pattern1\|pattern2\)'  
tail -f /var/log/file2 | grep '\(pattern3\|pattern4\|pattern5\)' 
I do not know how to have this working all together. Furthermore I would like to print file1 logs output in red and file2 logs output in blue:
Again, I can do it for one file (snippet I grabbed in this forum):
RED='\033[0;31m'
BLUE='\033[0;34m'  
tail -fn0 /var/log/file1 | while read line;
    do
       if echo $line | grep -q '\(pattern1\|pattern2\)';then
          echo -e "{$RED}$line"
       fi
    done
But I absolutely do not know how to do this for multiple files. Any ideas?
