Skip to content

Instantly share code, notes, and snippets.

@balidani
balidani / sample_log
Created June 1, 2012 14:44
Sample dataset to try a log sanitizing script
1000000000.834 127.0.0.2 "GET /verify-email?email=not_a_real_email%40not_a_real_website.com&chk=noTREaLDAtAButLo/OksLIKeb64&time=1335621340&userid=1234567890 HTTP/1.1" 200 2948 z=4.02 up=10.1.1.23:80 ms=0.736 ums=0.736 ol=- h=musicbrainz.org
1000000000.590 127.0.0.3 "GET /user/notarealuser HTTP/1.1" 200 3833 z=- up=10.1.1.20:80 ms=0.881 ums=0.881 ol=- h=musicbrainz.org
1000000000.390 127.0.0.4 "GET /lost-username HTTP/1.1" 200 3017 z=4.08 up=10.1.1.23:80 ms=0.136 ums=0.136 ol=- h=musicbrainz.org
1000000000.625 127.0.0.5 "GET /user/notarealuser2/edits?page=0 HTTP/1.1" 200 110046 z=- up=10.1.1.20:80 ms=3.838 ums=3.336 ol=- h=musicbrainz.org
1000000000.128 127.0.0.6 "GET /search/edits?auto_edit_filter=&order=desc&negation=0&combinator=and&conditions.0.field=artist&conditions.0.operator=%3D&conditions.0.name=xxx&conditions.0.args.0=0&conditions.0.user_id=1234567890&field=Please+choose+a+condition HTTP/1.1" 200 31750 z=- up=10.1.1.20:80 ms=4.691 ums=4.691 ol=- h=musicbrainz.org
1000000000.355 127.0.0.7 "GET /
search sourcetype="nginx_log" earliest=-1d@d latest=@d | regex url="^/ws/2/" | top 50 inc
search sourcetype="nginx_log" earliest=-1d@d latest=@d | regex url="^/ws/2/artist/" | top 50 inc
search sourcetype="nginx_log" earliest=-1d@d latest=@d | regex url="^/ws/2/release-group/" | top 50 inc
search sourcetype="nginx_log" earliest=-1d@d latest=@d | regex url="^/ws/2/release/" | top 50 inc
search sourcetype="nginx_log" earliest=-1d@d latest=@d | regex url="^/ws/2/recording/" | top 50 inc
search sourcetype="nginx_log" earliest=-1d@d latest=@d | regex url="^/ws/2/work/" | top 50 inc
search sourcetype="nginx_log" earliest=-1d@d latest=@d | regex url="^/ws/2/label/" | top 50 inc
search sourcetype="nginx_log" earliest=-1d@d latest=@d | regex url="^/ws/1/artist/" | regex query=".*" | stats count | eval name="Artists" | fields name, count
| append [search sourcetype="nginx_log" earliest=-1d@d latest=@d | regex url="^/ws/1/release-group/" | regex query=".*" | stats count | eval name="Release-groups" | fields name, co
import Image
import sys
def chunks(data, n):
"Yield successive n-sized chunks from data"
for i in xrange(0, len(data), n):
yield data[i:i+n]
width = 2880

Keybase proof

I hereby claim:

  • I am balidani on github.
  • I am dani (https://keybase.io/dani) on keybase.
  • I have a public key whose fingerprint is 311D AEA2 9960 4E3E 954A 7569 0A36 E842 C780 CBF1

To claim this, I am signing this object: