※ドメインごとのログを一つのログファイルにまとめる
cat */log/*.access_log > test.log
※できあがったログを日時順にソート
cat test.log | sed -e “s:/Jan/:/01/:” -e “s:/Feb/:/02/:” -e “s:/Mar/:/03/:” -e “s:/Apr/:/04/:” -e “s:/May/:/05/:” -e “s:/Jun/:/06/:” -e “s:/Jul/:/07/:” -e “s:/Aug/:/08/:” -e “s:/Sep/:/09/:” -e “s:/Oct/:/10/:” -e “s:/Nov/:/11/:” -e “s:/Dec/:/12/:” | sort -t ” ” -k 4.8,4.11 -k 4.5,4.6 -k 4.2,4.3 -k 4.13,4.14 -k 4.16,4.17 -k 4.19,4.20 > test2.log
参考URL:http://www.seoragnarok.com/blog/20130208191936.html