LoginSignup
1
2

More than 5 years have passed since last update.

Apacheから該当の日時のログだけサクッと抽出するコマンド

Last updated at Posted at 2016-07-15

初心者向け。
例えば、2016年6月13日21時26分のログだけ出力

sudo cat /var/log/httpd/access_log | grep -E '13\/Jul\/2016:21:26' > /home/username/access_log_`hostname`

過去すぎる時間のログは多分ローテートされてファイル名変わってるので取れないかもしれません。
あと日付の書式を設定変更していたら、それに合わせないと抽出できませんね。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2