Explorar el Código

Merge pull request #47 from lbonanomi/apache_log_slice

Apache log slicing
pull/51/head
@trimstray hace 5 años
committed by GitHub
padre
commit
df872dff0b
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: 4AEE18F83AFDEB23
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. +6
    -0
      README.md

+ 6
- 0
README.md Ver fichero

@@ -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)


Cargando…
Cancelar
Guardar