Kaynağa Gözat

Get the last 60 minutes of httpd logs from /var/log/httpd/access_log

pull/47/head
lbonanomi 5 yıl önce
ebeveyn
işleme
e76d0bb888
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. +6
    -0
      README.md

+ 6
- 0
README.md Dosyayı Görüntüle

@@ -2222,6 +2222,12 @@ awk '!x[$0]++' filename
awk '{$1=$3=""}1' filename
```

###### Get the last hour of Apache logs

```bash
awk '/'$(date -d "1 hours ago" "+%d\\/%b\\/%Y:%H:%M")'/,/'$(date "+%d\\/%b\\/%Y:%H:%M")'/ { print $0 }' /var/log/httpd/access_log
```

___

##### Tool: [sed](http://www.grymoire.com/Unix/Sed.html)


Yükleniyor…
İptal
Kaydet