<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Easy newbie question: How to make a modified version of Splunk's built-in knowledge about Apache access logs in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Easy-newbie-question-How-to-make-a-modified-version-of-Splunk-s/m-p/141977#M29072</link>
    <description>&lt;P&gt;I have a pile of Apache access logs where the format is just slightly modified from the default.  Is there any way I can leverage Splunk's existing knowledge of the "apache-common" sourcetype to get more intelligent parsing of my slightly modified format?&lt;/P&gt;

&lt;P&gt;Here's the original 'common' format definition:&lt;BR /&gt;
LogFormat"%h %l %u %t \"%r\" %&amp;gt;s %b" common&lt;/P&gt;

&lt;P&gt;...and here's the modified version:&lt;BR /&gt;
LogFormat "%{X-Forwarded-For}i %h %D %l %u %t \"%r\" %&amp;gt;s %b" common&lt;/P&gt;

&lt;P&gt;Basically we prepended the contents of the X-Forwarded-For header (a comma-and-space-separated list of IP addresses or "-") and then shifted around the other fields.&lt;/P&gt;

&lt;P&gt;Clearly there's no way Splunk is going to automagically figure that out -- but I'm stumped on where to start with telling it about the new format.&lt;/P&gt;

&lt;P&gt;So I am hoping there's some way in which I can look at what tells Splunk how to understand the default format, just as a starting point for building my new version.&lt;/P&gt;

&lt;P&gt;Seems like this must be a basic newbie question -- any tips would be appreciated.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Dec 2014 00:01:35 GMT</pubDate>
    <dc:creator>tgfurnish</dc:creator>
    <dc:date>2014-12-03T00:01:35Z</dc:date>
    <item>
      <title>Easy newbie question: How to make a modified version of Splunk's built-in knowledge about Apache access logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Easy-newbie-question-How-to-make-a-modified-version-of-Splunk-s/m-p/141977#M29072</link>
      <description>&lt;P&gt;I have a pile of Apache access logs where the format is just slightly modified from the default.  Is there any way I can leverage Splunk's existing knowledge of the "apache-common" sourcetype to get more intelligent parsing of my slightly modified format?&lt;/P&gt;

&lt;P&gt;Here's the original 'common' format definition:&lt;BR /&gt;
LogFormat"%h %l %u %t \"%r\" %&amp;gt;s %b" common&lt;/P&gt;

&lt;P&gt;...and here's the modified version:&lt;BR /&gt;
LogFormat "%{X-Forwarded-For}i %h %D %l %u %t \"%r\" %&amp;gt;s %b" common&lt;/P&gt;

&lt;P&gt;Basically we prepended the contents of the X-Forwarded-For header (a comma-and-space-separated list of IP addresses or "-") and then shifted around the other fields.&lt;/P&gt;

&lt;P&gt;Clearly there's no way Splunk is going to automagically figure that out -- but I'm stumped on where to start with telling it about the new format.&lt;/P&gt;

&lt;P&gt;So I am hoping there's some way in which I can look at what tells Splunk how to understand the default format, just as a starting point for building my new version.&lt;/P&gt;

&lt;P&gt;Seems like this must be a basic newbie question -- any tips would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2014 00:01:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Easy-newbie-question-How-to-make-a-modified-version-of-Splunk-s/m-p/141977#M29072</guid>
      <dc:creator>tgfurnish</dc:creator>
      <dc:date>2014-12-03T00:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Easy newbie question: How to make a modified version of Splunk's built-in knowledge about Apache access logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Easy-newbie-question-How-to-make-a-modified-version-of-Splunk-s/m-p/141978#M29073</link>
      <description>&lt;P&gt;This is what I found, I hope it helps. It is untested but should be functional.&lt;/P&gt;

&lt;P&gt;Reference Document-&amp;gt; &lt;A href="http://httpd.apache.org/docs/1.3/logs.html"&gt;http://httpd.apache.org/docs/1.3/logs.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I would personally change the search names to something smaller, but I altered it slightly to name value pairs. Here is the altered query string.&lt;/P&gt;

&lt;P&gt;"xforwarder=%{X-Forwarded-For}i IP=%h userid=%u time=%t request="%r" responseCode=%&amp;gt;s responseSize=%b" &lt;/P&gt;

&lt;P&gt;I removed %D and %l as they are undefined and filler respectively.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;%l  =&amp;gt; -&lt;/LI&gt;
&lt;LI&gt;%D=&amp;gt; not on the page&lt;/LI&gt;
&lt;LI&gt;%h=&amp;gt; IP Address&lt;/LI&gt;
&lt;LI&gt;\"%{Referer}i\" =&amp;gt;referrer I didn't use but could see value in adding&lt;/LI&gt;
&lt;LI&gt;\"%{User-agent}i\"" =&amp;gt; user-Agent&lt;/LI&gt;
&lt;LI&gt;%r =&amp;gt; The request line from the client is given in double quotes.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 03 Dec 2014 13:16:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Easy-newbie-question-How-to-make-a-modified-version-of-Splunk-s/m-p/141978#M29073</guid>
      <dc:creator>rptrahin</dc:creator>
      <dc:date>2014-12-03T13:16:34Z</dc:date>
    </item>
  </channel>
</rss>

