Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add README

  • Loading branch information...
commit cd8c5bae7ed4b5d6f92f6da6a2137a11c786bc7a 1 parent eae000e
Gareth Rees authored

Showing 1 changed file with 42 additions and 0 deletions. Show diff stats Hide diff stats

  1. +42 0 README.md
42 README.md
Source Rendered
... ... @@ -0,0 +1,42 @@
  1 +# Search for a pattern in your log files
  2 +
  3 +I generally use a tracking gif in the mass emails I send out to get a rough idea of the open rate. It's not a small task to open each log file, filter it and then count each occurance of the gif.
  4 +
  5 +Hunter does this for you!
  6 +
  7 +**WARNING:** Hunter has <u>**no tests**</u>. This was thrown together, so use with caution. Contributions are very welcome.
  8 +
  9 +## How to Use
  10 +
  11 +### Install
  12 +
  13 + gem install hunter
  14 +
  15 +### Use
  16 +
  17 +Create a new hunt for the string you want to match:
  18 +
  19 + hunt = Hunter::Hunt.new('/images/email/tracking.gif')
  20 +
  21 +#### Look in the current log
  22 +
  23 + hunt.look_in('/var/log/httpd/access.log')
  24 +
  25 +#### Look in an archived log
  26 +
  27 + hunt.look_in_archived('/var/log/httpd/log_archive/access.log.1.gz')
  28 +
  29 +#### Look through a folder of archived logs
  30 +
  31 + hunt.look_through_archive('/var/log/httpd/log_archive')
  32 +
  33 +#### Look through a folder of archived logs for a specific log type
  34 +
  35 + hunt.look_through_archive('/var/log/httpd/log_archive', 'access.log')
  36 +
  37 +## Known Issues
  38 +
  39 +* "Archived" means with the file extension `.gz` – no other compression formats are supported
  40 +* `look_through_archive()` relies on your log appending a digit after the original filename and then compressing to `.gz`
  41 + * e.g. `access.log` becomes `access.log.1.gz`
  42 +* **There are no tests**

0 comments on commit cd8c5ba

Please sign in to comment.
Something went wrong with that request. Please try again.