Created
June 11, 2020 18:53
-
-
Save KarimJedda/da3c3c51653716da5c3947e50908b4d3 to your computer and use it in GitHub Desktop.
Piping Nginx logs to AWK and format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get all the logs | |
tail -f /var/log/nginx/access.log | | |
# Extract IP and Timestamp for example | |
awk '{print $1 " " substr($4, 2, length($4) - 7)}' FPAT='[^ ]*|"[^"]*"|\\[[^]]*\\]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment