Skip to content

Instantly share code, notes, and snippets.

@jcartledge
Created March 22, 2013 03:33
Show Gist options
  • Save jcartledge/5218752 to your computer and use it in GitHub Desktop.
Save jcartledge/5218752 to your computer and use it in GitHub Desktop.
Parse timestamps, queries and facets out of Apache Solr logs.
#!/usr/bin/env bash
cat 20* | grep solr/select | perl -MURI::Escape -ne 's/(\d+\.\d+\.\d+\.\d+)[\s\-]+\[([^\]]+)\] "GET \/solr\/select.*(&fq=([^&]*)?).*(&q=([^&]*)?).* 200 /\2\t\6\t\4\t/ && print uri_unescape($_)' -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment