<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: I need a freeware that will scan an NCSA logfile</title>
	<link>http://ask.metafilter.com/13191/I-need-a-freeware-that-will-scan-an-NCSA-logfile/</link>
	<description>Comments on Ask MetaFilter post I need a freeware that will scan an NCSA logfile</description>
	<pubDate>Mon, 20 Dec 2004 09:25:17 -0800</pubDate>
	<lastBuildDate>Mon, 20 Dec 2004 09:25:17 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: I need a freeware that will scan an NCSA logfile</title>
		<link>http://ask.metafilter.com/13191/I-need-a-freeware-that-will-scan-an-NCSA-logfile</link>	
		<description>I want a utility (freeware?) which will scan an NCSA extended logfile and create a simple report on which referrers generated how many sales transactions.&lt;br&gt;
&lt;br&gt;
Any recommendations?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2004:site.13191</guid>
		<pubDate>Mon, 20 Dec 2004 08:36:47 -0800</pubDate>
		<dc:creator>ZenMasterThis</dc:creator>
		
			<category>Freeware</category>
		
			<category>Utility</category>
		
			<category>Software</category>
		
			<category>NCSA</category>
		
			<category>Logfile</category>
		
			<category>Scan</category>
		
			<category>Report</category>
		
			<category>Sales</category>
		
			<category>Recommendation</category>
		
	</item> <item>
		<title>By: RustyBrooks</title>
		<link>http://ask.metafilter.com/13191/I-need-a-freeware-that-will-scan-an-NCSA-logfile#228282</link>	
		<description>You&apos;ll probably have to write something for yourself.  It might not be easy.  Like, do the log files have something in them that will tell you when a sale was made?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2004:site.13191-228282</guid>
		<pubDate>Mon, 20 Dec 2004 09:25:17 -0800</pubDate>
		<dc:creator>RustyBrooks</dc:creator>
	</item><item>
		<title>By: weston</title>
		<link>http://ask.metafilter.com/13191/I-need-a-freeware-that-will-scan-an-NCSA-logfile#228304</link>	
		<description>I don&apos;t think there is anything standalone out there that does this, though I know some commerce packages have this built in, as I&apos;ve written this feature for at least one of them.&lt;br&gt;
&lt;br&gt;
High precision might be somewhat difficult, given that there&apos;s really nothing that goes into a standard extended log file that can completely reliably identify an individual. It shouldn&apos;t be too hard to do roughly, though. What you really want is to catch two ends of a click trail -- one that starts with a referer from a foreign domain, one that ends with the call of a specific resource (a page or a script) that signifies a completed sale. You can use the remote host/ip field somewhat reliably to identify an individuals requests.&lt;br&gt;
&lt;br&gt;
A quick and dirty algorithm in something like perl would be to generate a hash of all requests from a given host/ip, with the key based on that host/ip. Make special note of host/ip&apos;s from which a request to the &quot;sale complete&quot; resource is made.  Then, for each of those hosts, find the initial request and print the referer if any.&lt;br&gt;
&lt;br&gt;
while($line = &amp;lt;LOGFILE&amp;gt;)&lt;br&gt;
{&lt;br&gt;
          $line =~ m/$someRegExpThatParsesLogFiles/;&lt;br&gt;
          $host_or_ip = $1;&lt;br&gt;
          $request = $4; // or something like that&lt;br&gt;
          push $requestsByHost{$host_or_ip}, $line;&lt;br&gt;
          if($request =~ m/$saleResourceName/)&lt;br&gt;
          {   push @hostsThatBought, $host_or_ip; }&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
foreach $hostThatBought (@hostsThatBought)&lt;br&gt;
{&lt;br&gt;
          @requestsFromHost = $requestsByHost{$hostThatBought};&lt;br&gt;
          foreach $requestFromHost (@requestsFromHost)&lt;br&gt;
          {&lt;br&gt;
                 if($requestFromHost =~ m/$regExpThatGetsReferer/)&lt;br&gt;
                 { print $requestFromHost; }&lt;br&gt;
          }&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
This is ineffecient, imprecise, and has at least one reference problem. But it might give you a start.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2004:site.13191-228304</guid>
		<pubDate>Mon, 20 Dec 2004 09:59:29 -0800</pubDate>
		<dc:creator>weston</dc:creator>
	</item><item>
		<title>By: grouse</title>
		<link>http://ask.metafilter.com/13191/I-need-a-freeware-that-will-scan-an-NCSA-logfile#228312</link>	
		<description>Be sure you remember that &lt;a href=&quot;http://ask.metafilter.com/mefi/13133&quot;&gt;you can&apos;t rely on referer to be reported accurately&lt;/a&gt;.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2004:site.13191-228312</guid>
		<pubDate>Mon, 20 Dec 2004 10:07:59 -0800</pubDate>
		<dc:creator>grouse</dc:creator>
	</item>
	</channel>
</rss>
