Created
August 13, 2012 21:49
-
-
Save vadimg/3344325 to your computer and use it in GitHub Desktop.
nginx access log GET request extractor
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
#!/usr/bin/env python | |
import sys | |
import re | |
def iterpings(filename): | |
for line in open(filename): | |
m = re.search(r'] GET (.*?) ', line) | |
if m is not None: | |
yield m.group(1) | |
if __name__ == '__main__': | |
filename = sys.argv[1] | |
for x in iterpings(filename): | |
print x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment