<?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 Re: Can't get sourcetype right in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28928#M4972</link>
    <description>&lt;P&gt;Your first approach should have worked, but I image you had a typo or permissions setting getting in the way.  I would also like to point out that there are limitations in simply forcing a &lt;CODE&gt;sourcetype&lt;/CODE&gt; on all of your &lt;CODE&gt;inputs.conf&lt;/CODE&gt; stanzas as was suggested above.  For example, say you had two different types of logs in &lt;CODE&gt;/foo/barr/logs/APPSRV*&lt;/CODE&gt; and you want to use two different sourcetypes?  How would you get the proper sourcetype assigned?  (Splunk 4.1 makes this slightly easier, but there are still some limitations.)&lt;/P&gt;

&lt;P&gt;I highly recommend using the following command line tool to debug your .props files:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk test sourcetype /foo/barr/logs/APPSRV/some_log_file.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should return the sourcetype associated with your log file and show you all the props settings associated with it.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I put together a list of common debugging techniques on a different post.  You may find some of it helpful:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/questions/4075/whats-the-best-way-to-track-down-props-conf-problems" rel="nofollow"&gt;What’s the best way to track down props.conf problems?&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Aug 2010 21:50:39 GMT</pubDate>
    <dc:creator>Lowell</dc:creator>
    <dc:date>2010-08-18T21:50:39Z</dc:date>
    <item>
      <title>Can't get sourcetype right</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28925#M4969</link>
      <description>&lt;P&gt;Hi. &lt;/P&gt;

&lt;P&gt;Seems like a lot of people have a question similar to this, but maybe I am missing something simple.  I'm monitoring logs in a directory (/foo/barr/logs/APPSRV*). Logs are sent to the indexer via the SplunkLightForwarder. The wild card is because the log file names are dynamic (they have a timestamp on the end of them)&lt;/P&gt;

&lt;P&gt;I created a props.conf in /splunk/etc/apps/search/local with the following entry on the SplunkLightForwarder: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source:///foo/barr/logs/APPSRV*]
sourcetype=appsrv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Unfortunately, the sourcetype still comes out wrong. It shows up as APPSRV-too_small. I then tried putting props.conf in /splunk/etc/apps/search/default, but that didn't help either.&lt;/P&gt;

&lt;P&gt;I think I'm missing something fundamental here...&lt;/P&gt;

&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2010 22:47:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28925#M4969</guid>
      <dc:creator>Branden</dc:creator>
      <dc:date>2010-08-12T22:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get sourcetype right</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28926#M4970</link>
      <description>&lt;P&gt;In $SPLUNK_HOME/etc/system/local/inputs.conf&lt;/P&gt;

&lt;P&gt;If you are using the file system change:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[fschange:/foo/barr/logs/APPSRV*]
sourcetype = appsrv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For monitoring the files/folders:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///foo/barr/logs/APPSRV*]
sourcetype = appsrv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;A great resource to find out more about the inputs.conf is: &lt;A href="http://www.splunk.com/base/Documentation/4.1.4/admin/Inputsconf" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1.4/admin/Inputsconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2010 22:58:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28926#M4970</guid>
      <dc:creator>treinke</dc:creator>
      <dc:date>2010-08-12T22:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get sourcetype right</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28927#M4971</link>
      <description>&lt;P&gt;Worked great, thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2010 00:54:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28927#M4971</guid>
      <dc:creator>Branden</dc:creator>
      <dc:date>2010-08-13T00:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get sourcetype right</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28928#M4972</link>
      <description>&lt;P&gt;Your first approach should have worked, but I image you had a typo or permissions setting getting in the way.  I would also like to point out that there are limitations in simply forcing a &lt;CODE&gt;sourcetype&lt;/CODE&gt; on all of your &lt;CODE&gt;inputs.conf&lt;/CODE&gt; stanzas as was suggested above.  For example, say you had two different types of logs in &lt;CODE&gt;/foo/barr/logs/APPSRV*&lt;/CODE&gt; and you want to use two different sourcetypes?  How would you get the proper sourcetype assigned?  (Splunk 4.1 makes this slightly easier, but there are still some limitations.)&lt;/P&gt;

&lt;P&gt;I highly recommend using the following command line tool to debug your .props files:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk test sourcetype /foo/barr/logs/APPSRV/some_log_file.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should return the sourcetype associated with your log file and show you all the props settings associated with it.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I put together a list of common debugging techniques on a different post.  You may find some of it helpful:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/questions/4075/whats-the-best-way-to-track-down-props-conf-problems" rel="nofollow"&gt;What’s the best way to track down props.conf problems?&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2010 21:50:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28928#M4972</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-08-18T21:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get sourcetype right</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28929#M4973</link>
      <description>&lt;P&gt;Your first approach didn't work because of the difference in naming convention for stanzas in inputs.conf and props.conf.&lt;/P&gt;

&lt;P&gt;In inputs.conf, stanzas look like URIs, so they have a scheme (say monitor, tcp or udp) followed by "://" followed by a path.&lt;/P&gt;

&lt;P&gt;On the other hand, props.conf just looks at the fields source, sourcetype or host. So the stanzas in props.conf should be named: &lt;CODE&gt;[&amp;lt;sourcetype&amp;gt;] [source::&amp;lt;source&amp;gt;] [host::&amp;lt;host&amp;gt;]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The "::" here is a inherited from when all fields in Splunk were indicated by field::value rather than field=value.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2010 21:56:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28929#M4973</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-08-18T21:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get sourcetype right</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28930#M4974</link>
      <description>&lt;P&gt;If you starting seeing "&lt;EM&gt;*&lt;/EM&gt;*-too_small" it means that the indexing is being learned, and not using your props.conf or transforms.conf settings.  So, a couple things:&lt;/P&gt;

&lt;P&gt;First, you shouldn't replace any of the documents/configuration files within the Default folder.  Use either the Apps folder or the Local folder for your custom config.  Second, there are a few bugs in the past (true with IIS at some point) that no matter how you specify the sourcetype, it will only grab the name, and learn the rest automatically.  So that's something that needs to be fixed on the software.  Third, when you re-add/re-index, make sure you clear the learned configurations.  This is located on the Apps folder under learned.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2010 21:57:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28930#M4974</guid>
      <dc:creator>BunnyHop</dc:creator>
      <dc:date>2010-08-18T21:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get sourcetype right</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28931#M4975</link>
      <description>&lt;P&gt;Splunk support showed us how to do it using an approach like this:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;inputs.conf&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;/STRONG&gt; on the lightweight &lt;STRONG&gt;forwarder&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///foo/bar/logs/]
disabled = false
host = myServer_myApplication
crcSalt = &amp;lt;SOURCE&amp;gt;
blacklist = \.(tar|gz|bz2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;/STRONG&gt; on the &lt;STRONG&gt;indexer&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/foo/bar/logs/.../*]
TRANSFORMS-foobarlogs = fix_foo_bar_logs_sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;/STRONG&gt; on the &lt;STRONG&gt;indexer&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[fix_foo_bar_logs_sourcetype]
REGEX=.
FORMAT=sourcetype::foo_bar_log
DEST_KEY=MetaData:Sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;This approach is the only way we have found to reliably set the sourcetype for the vast majority of our logs.&lt;/P&gt;

&lt;P&gt;If we pick up the logs on the indexer, we can simplify this by setting the sourcetype in the inputs.conf directly:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///foo/bar/logs/]
disabled = false
sourcetype = foo_bar_log
host = myServer_myApplication
crcSalt = &amp;lt;SOURCE&amp;gt;
blacklist = \.(tar|gz|bz2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Aug 2010 01:08:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-t-get-sourcetype-right/m-p/28931#M4975</guid>
      <dc:creator>rotten</dc:creator>
      <dc:date>2010-08-19T01:08:00Z</dc:date>
    </item>
  </channel>
</rss>

