mirror of
https://github.com/trimstray/the-book-of-secret-knowledge
synced 2024-12-28 09:59:00 +01:00
Get the last 60 minutes of httpd logs from /var/log/httpd/access_log
This commit is contained in:
parent
0f0e5d3d9d
commit
e76d0bb888
1 changed files with 6 additions and 0 deletions
|
@ -2222,6 +2222,12 @@ awk '!x[$0]++' filename
|
||||||
awk '{$1=$3=""}1' 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)
|
##### Tool: [sed](http://www.grymoire.com/Unix/Sed.html)
|
||||||
|
|
Loading…
Reference in a new issue