Skip to content

Instantly share code, notes, and snippets.

@koko1000ban
Created July 27, 2012 04:46
Show Gist options
  • Save koko1000ban/3186222 to your computer and use it in GitHub Desktop.
Save koko1000ban/3186222 to your computer and use it in GitHub Desktop.
log解析 rubyさん
ruby -e "puts STDIN.map{|line| line.split(/ /)}.select{|log| log[-1].to_f > 5.0 }.map{|log| log.join(' ')}" < access.log
#色付き
ruby -e "puts STDIN.map{|line| line.chomp.split(/ /)}.select{|log| log[-1].to_f > 5.0 }.map{|log| log[-1]=\"\e[31m\"+log[-1]+\"\e[0m\"; log.join(' ')}" < access.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment