[olug] Splunk and log scraping
Aric Aasgaard
aric at omahax.com
Mon Dec 21 13:18:05 UTC 2009
Curtis LaMasters recommended:
http://www.phplogcon.org/
http://www.phplogcon.org/module-Static_Docs-view-f-/basics.html.phtml
Here is a function I used to grab all the files in a directory for a website
app I made.
#######################################################################
<?php
function dirList ($directory)
{
// create an array to hold directory list
$results = array();
// create a handler for the directory
$handler = opendir($directory);
// keep going until all files in directory have been read
while ($file = readdir($handler)) {
// if $file isn't this directory or its parent,
// add it to the results array
if ($file != '.' && $file != '..')
$results[] = $file;
}
// tidy up: close the handler
closedir($handler);
// done!
return $results;
}
?>
#######################################################################
Without looking I would say that it shouldn't to difficult to add a function
to phplogcon for it to take directories.
I'll tell you what, I'll make you an awesome custom made open source web app
that does this for only $100,000 a year. :)
More information about the OLUG
mailing list