Skip to content

Instantly share code, notes, and snippets.

@velp
Last active January 28, 2021 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velp/f15e63a4fced72c46690a19c54a0d117 to your computer and use it in GitHub Desktop.
Save velp/f15e63a4fced72c46690a19c54a0d117 to your computer and use it in GitHub Desktop.
OpenStack log colorized

It helps to analize OpenStack logs, example Screenshot 2021-01-28 at 14 41 27

Create sed rules file:

cat > /tmp/log_colorized.sed <<EOL
s/(INFO.*)/\x1B[32m\1\x1B[0m/
s/(ERROR.*)/\x1B[31m\1\x1B[0m/
s/(WARNING.*)/\x1B[33m\1\x1B[0m/
s/(CRITICAL.*)/\x1B[31m\1\x1B[0m/
EOL

Usage:

tail -f /var/log/neutron/neutron-openvswitch-agent.log | sed -r -f /tmp/log_colorized.sed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment