grep is capable of color-highlighting the matched string in its output. But, by default, that option is turned off.
$ grep abc a_file.txt
abcdef
There are 3 color options available to you:
–color=auto
–color=always
–color=never
Read More
Tag: grep
Test filters using fail2ban
Whenever you add or change a filter you will want to test that the regular expressions are correct by running it over an existing logfile.
The tool for doing this is fail2ban-regex which is used as follows:
fail2ban-regex /var/log/fail2ban.log /etc/fail2ban/filter.d/fail2ban-smtp.conf