Skip to content

Instantly share code, notes, and snippets.

@vadimg
Created August 13, 2012 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vadimg/3344325 to your computer and use it in GitHub Desktop.
Save vadimg/3344325 to your computer and use it in GitHub Desktop.
nginx access log GET request extractor
#!/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