Created
February 8, 2011 05:47
-
-
Save yuya-takeyama/815945 to your computer and use it in GitHub Desktop.
Colorizes your Apache's access logs.
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
#!/usr/bin/env ruby | |
STDIN.each do |line| | |
puts line.sub(/"(?:(PUT|POST|GET|HEAD|DELETE|OPTIONS) ([^\s]*)) (HTTP\/\d\.\d)" (\d+)/, "\"\e[1;31m\\1\e[0m \e[1;32m\\2\e[0m \\3\" \e[1;33m\\4\e[0m") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment