<?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 Defining custom sourcetypes. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Defining-custom-sourcetypes/m-p/12211#M932</link>
    <description>&lt;P&gt;I'm trying to define a custom set of fields for a sourcetype and am finding that the "train" command is a) tedious b) doesn't work. Here's the basic format of my apache log:&lt;/P&gt;

&lt;P&gt;LogFormat "%h %l %u %t %P \"%r\" %&amp;gt;s %X %b %I %O %D \"%{Referer}i\" \"%{User-Agent}i\" \"%{Host}i\" \"%{X-Forwarded-For}i\" \"%{X-Cluster-Client-IP}i\" \"%{True-Client-IP}i\" \"%{Via}i\" \"%{Akamai-Origin-Hop}i\""&lt;/P&gt;

&lt;P&gt;I just want a way to create a definition from this that extracts these fields and am not finding a good way to do this. Am I missing something?&lt;/P&gt;</description>
    <pubDate>Sat, 24 Apr 2010 01:58:12 GMT</pubDate>
    <dc:creator>maxmichaels</dc:creator>
    <dc:date>2010-04-24T01:58:12Z</dc:date>
    <item>
      <title>Defining custom sourcetypes.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Defining-custom-sourcetypes/m-p/12211#M932</link>
      <description>&lt;P&gt;I'm trying to define a custom set of fields for a sourcetype and am finding that the "train" command is a) tedious b) doesn't work. Here's the basic format of my apache log:&lt;/P&gt;

&lt;P&gt;LogFormat "%h %l %u %t %P \"%r\" %&amp;gt;s %X %b %I %O %D \"%{Referer}i\" \"%{User-Agent}i\" \"%{Host}i\" \"%{X-Forwarded-For}i\" \"%{X-Cluster-Client-IP}i\" \"%{True-Client-IP}i\" \"%{Via}i\" \"%{Akamai-Origin-Hop}i\""&lt;/P&gt;

&lt;P&gt;I just want a way to create a definition from this that extracts these fields and am not finding a good way to do this. Am I missing something?&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2010 01:58:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Defining-custom-sourcetypes/m-p/12211#M932</guid>
      <dc:creator>maxmichaels</dc:creator>
      <dc:date>2010-04-24T01:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Defining custom sourcetypes.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Defining-custom-sourcetypes/m-p/12212#M933</link>
      <description>&lt;P&gt;You can add a stanza on your props.conf and transforms.conf:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;
[customsourcetype]
TRANSFORMS-logformat = customlogformat
&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;
[customlogformat]
REGEX = ****insert regex here****
FORMAT = field1::$1 field2::$2 field3::$3
&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Apr 2010 02:22:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Defining-custom-sourcetypes/m-p/12212#M933</guid>
      <dc:creator>BunnyHop</dc:creator>
      <dc:date>2010-04-24T02:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Defining custom sourcetypes.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Defining-custom-sourcetypes/m-p/12213#M934</link>
      <description>&lt;P&gt;You can specify singularly formatted extractions within props.conf directly, or if you need multiple formats you can use a combination of props and transforms.   There are default extractions built into Splunk for apache access and error logs.   These can be referenced in $SPLUNK_HOME/etc/system/default/transforms.conf under the "access-extractions" stanza:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[access-extractions]
# matches access-common or access-combined apache logging formats
# Extracts: clientip, clientport, ident, user, req_time, method, uri, root, file, uri_domain, uri_query, version, status, bytes, referer_url, referer_domain, referer_proto, useragent, cookie, other (remaining chars)
# Note: referer is misspelled in purpose because that is the "official" spelling for "HTTP referer"
REGEX = ^[[nspaces:clientip]]\s++[[nspaces:ident]]\s++[[nspaces:user]]\s++[[sbstring:req_time]]\s++[[access-request]]\s++[[nspaces:status]]\s++[[nspaces:bytes]](?:\s++"(?&amp;lt;referer&amp;gt;[[bc_domain:referer_]]?+[^"]*+)"(?:\s++[[qstring:useragent]](?:\s++[[qstring:cookie]])?+)?+)?[[all:other]]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you need to make a custom format, you could use the above as a template for a new extraction for your particular custom log file.   &lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2010 04:59:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Defining-custom-sourcetypes/m-p/12213#M934</guid>
      <dc:creator>Simeon</dc:creator>
      <dc:date>2010-04-24T04:59:55Z</dc:date>
    </item>
  </channel>
</rss>

