Created
August 28, 2015 04:45
-
-
Save johnroyer/b06abe412b51dd1f9544 to your computer and use it in GitHub Desktop.
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
BEGIN { | |
} | |
{ | |
split($0, token, " "); | |
remoteIp = token[1]; | |
httpStauts = token[9]; | |
# time | |
split($0, timequote, "["); | |
split(timequote[2], timequote2, "]"); | |
time = timequote2[1]; | |
# header | |
split($0, quote, "\""); | |
split(quote[2], header, " "); | |
method = header[1]; | |
path = header[2]; | |
protocol = header[3]; | |
# user agent | |
agent = quote[6]; | |
print time, "\t", remoteIp, "\t", method, "\t", path, "\t", protocol, "\t", agent; | |
} | |
END { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment