Created
February 10, 2012 11:54
-
-
Save aabril/1789037 to your computer and use it in GitHub Desktop.
see clients ip's from a nginx log
This file contains 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
# input: | |
# 2012/02/10 09:32:36 [error] 17798#0: *30890 open() "/var/www/media/icon.png" failed (2: No such file or directory), | |
# client: 10.10.100.100, server: dev.myserver.com, request: "GET /media/icon.png HTTP/1.1", host: "dev.myserver.com", | |
# referrer: "http://dev.myserver.com/index" | |
# | |
# output | |
# client: 10.10.100.100 | |
cat error.log | grep client | awk 'BEGIN {FS="client: "}{print "client: "$2}' | cut -d "," -f 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment