Last active
June 29, 2017 18:11
-
-
Save nega0/0e37929e6b23b568566c40b8071cdac2 to your computer and use it in GitHub Desktop.
colorize `iptables` with grc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## based on https://gist.github.com/nega0/1d232622a1fa3dad176869bbfe747602 | |
## conf file for https://github.com/garabik/grc | |
## put in ~/.grc/conf.iptables | |
# chain section headers | |
regexp=^Chain.* | |
colors=underline | |
======= | |
# column headers | |
regexp=^num.* | |
colors=yellow | |
======= | |
# reject/drop | |
regexp=([^y] )(DROP|REJECT) | |
colors=,,red | |
======= | |
# accept | |
regexp=[^y] (ACCEPT) | |
colors=,green | |
======= | |
# port numbers | |
regexp=[ds]pt[s]?:(\d+(:\d+)?) | |
colors=,yellow | |
======= | |
# ip number | |
regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?:\/\d{1,2})? | |
colours=cyan | |
======= | |
# LOGDROP | |
regexp=([^n] )(LOGDROP) | |
colors=,,yellow | |
======= | |
# LOG | |
regexp=( )LOG | |
colors=cyan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment