I am looking for example code using YQL to handle a web server log file.
YQL table for Apache access logs asks "What about a table for Apache access logs?" to which spullara replies:
If we add something like this it will likely be with a regex based line reader that you could then apply to apache logs.
later Paul Tarjan says:
There is now a regex table
http://developer.yahoo.com/yql/console/?q=select%20%20from%20regex%20where%20expression%20%3D%20%22%28.%29%22%20and%20text%3D%22test%22&env=http%3A%2F%2Fdatatables.org%2Falltables.env
So, it looks the regex feature has been added to YQL.
I would like to see a complete YQL example using this regex feature using this sample log file. Here is a line from the sample log file:
69.12.127.10 - - 02/Sep/2009:01:53:52 MDT "GET /holeman/cgi-bin/get_page.cgi?../cxx/sw_stack" HTTP/1.1 200 999 Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.2) Gecko/20090810 Ubuntu/9.10 (karmic) Firefox/3.5.2
Display just the IP addresses and pages referenced which for the above sample line would be:
69.12.127.10 /holeman/cgi-bin/get_page.cgi?../cxx/sw_stack
In the Paul Tarjan example the values for expression
and text
are hard coded. How would one reference the text
in the file http://sky.prohosting.com/holeman/yql/serverlog/20090902.txt? Also, for expression
how can one use a reference rather than a hard coded value?