Note: You may use either double or single quotes. Choose your favorite and stick with it for consistency. We decided to use double and single in these examples for illustrative purposes.

Scenario 1 – Access Logs: Which IPs accessed my WordPress plugins directory on Sep 15, 2015? Color the date and time in the default color (red) and the plugin accessed in light blue (1;34):

grep '15/Sep/2015.*]' --color=always /path_to/log_file/log/access.log | GREP_COLORS='mt=1;34' grep 'plugins/.*HTTP/' --color=always |more

Scenario 2 – Error Logs: Find which IPs are generating errors on my server from Sep 20 to Sep 29, 2015. Also, highlight the IPs in white (1;37) and the event date in the default color:

grep "Sep 2.*2015" --color=always /path_to/log_file/error.log | GREP_COLORS="mt=1;37" grep "client .*]" --color=always |more 

Where:

  1. GREP_COLORS: color directive. You may read more about it on the GNU grep manual Environment Variables page
  2. mt: highlight Matching Text
  3. 1;37: in the color white. Ben Arwin has complete color code table

Image from Ben Arwin:

From Ben Arwin
References
  1. http://askubuntu.com/questions/234543/grep-how-to-color-2-keywords
  2. http://www.gnu.org/software/grep/manual/html_node/Environment-Variables.html
  3. http://unix.stackexchange.com/questions/104350/multicolored-grep
  4. http://askubuntu.com/a/234547/453486
  5. http://linuxaria.com/pills/coloring-grep-to-easier-research
  6. http://www.arwin.net/tech/bash.php
  7. http://alexiobash.com/colorare-grep-per-ricerche-mirate/
  8. http://stackoverflow.com/questions/17236005/grep-output-with-multiple-colors