<?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 Why is the sourcetype set as filename in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476548#M81803</link>
    <description>&lt;P&gt;Hello &lt;/P&gt;

&lt;P&gt;I have some syslog data collected and forwarded to a custom path: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/var/log/remote/2020/&amp;lt;month&amp;gt;/messages/&amp;lt;filename&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This data, for most logs got the correct sourcetype = syslog&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; inputs.conf:
[monitor:///var/log/remote/.../messages]
whitelist=(archive|\_messages\.log|_messages\.log\-)
blacklist=(\.bz2$)
index=nix_os
sourcetype = syslog
disabled = 0
recursive=true
crcSalt=SOURCE1

props.conf

[source::.../var/log/remote/.../messages*]
    sourcetype = syslog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have unfortunately seen an issue where if the file is below a certain size it gets the filename set as the sourcetype &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;filename:
hostname.env.ext.company.com_messages.log

path to filename:
/var/log/remote/2020/02/env/messages/hostname.env.ext.company.com_messages.log

sourcetype set as:
hostname.env.ext.company.com_messages
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Why would the sourcetype get created as the filename?&lt;/P&gt;

&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2020 16:05:54 GMT</pubDate>
    <dc:creator>tkw03</dc:creator>
    <dc:date>2020-02-19T16:05:54Z</dc:date>
    <item>
      <title>Why is the sourcetype set as filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476548#M81803</link>
      <description>&lt;P&gt;Hello &lt;/P&gt;

&lt;P&gt;I have some syslog data collected and forwarded to a custom path: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/var/log/remote/2020/&amp;lt;month&amp;gt;/messages/&amp;lt;filename&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This data, for most logs got the correct sourcetype = syslog&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; inputs.conf:
[monitor:///var/log/remote/.../messages]
whitelist=(archive|\_messages\.log|_messages\.log\-)
blacklist=(\.bz2$)
index=nix_os
sourcetype = syslog
disabled = 0
recursive=true
crcSalt=SOURCE1

props.conf

[source::.../var/log/remote/.../messages*]
    sourcetype = syslog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have unfortunately seen an issue where if the file is below a certain size it gets the filename set as the sourcetype &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;filename:
hostname.env.ext.company.com_messages.log

path to filename:
/var/log/remote/2020/02/env/messages/hostname.env.ext.company.com_messages.log

sourcetype set as:
hostname.env.ext.company.com_messages
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Why would the sourcetype get created as the filename?&lt;/P&gt;

&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 16:05:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476548#M81803</guid>
      <dc:creator>tkw03</dc:creator>
      <dc:date>2020-02-19T16:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the sourcetype set as filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476549#M81804</link>
      <description>&lt;P&gt;Remove attribute &lt;STRONG&gt;sourcetype = syslog&lt;/STRONG&gt; in stanza [source::.../var/log/remote/.../messages*] in props.conf and check.&lt;/P&gt;

&lt;H2&gt;Update:&lt;/H2&gt;

&lt;P&gt;This looks like default splunk behaviour. Try with following configurations.&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [source::.../var/log/remote/.../*messages.log(.\d+)?]
 TRANSFORMS-change_sourcetype_syslogs = change_sourcetype_syslogs

 [source::.../var/log/remote/.../*audisp.log(.\d+)?]]
 TRANSFORMS-change_sourcetype_audit = change_sourcetype_audit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[change_sourcetype_syslogs]
REGEX = .*
FORMAT = sourcetype::syslogs
DEST_KEY = MetaData:Sourcetype

[change_sourcetype_audit]
REGEX = .*
FORMAT = sourcetype::linux:audit
DEST_KEY = MetaData:Sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Feb 2020 17:01:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476549#M81804</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-02-19T17:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the sourcetype set as filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476550#M81805</link>
      <description>&lt;P&gt;I did change my props and inputs a bit:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    Inputs:
    [monitor:///var/log/remote/.../*messages.log(.\d+)?]
    whitelist=(archive|\_messages\.log|_messages\.log\-)
    blacklist=(\.bz2$)
    index=nix_os
    sourcetype = syslog
    disabled = 0
    recursive=true
    crcSalt = &amp;lt;SOURCE&amp;gt;


    [monitor:///var/log/remote/.../*audisp.log(.\d+)?]]
    whitelist=(archive|\_audisp.log|\audisp.log\-)
    blacklist=(\.bz2$)
    index=nix_os
    sourcetype = linux:audit
    disabled = 0
    recursive=true
    crcSalt = &amp;lt;SOURCE&amp;gt;





    Props:
    [source::.../var/log/remote/.../*messages.log(.\d+)?]
    sourcetype = syslog

    [source::.../var/log/remote/.../*audisp.log(.\d+)?]]
    sourcetype = linux:audit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This has almost worked but I still get the too_small sourcetypes as well as the filename as sourcetype&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 14:29:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476550#M81805</guid>
      <dc:creator>tkw03</dc:creator>
      <dc:date>2020-03-03T14:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the sourcetype set as filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476551#M81806</link>
      <description>&lt;P&gt;I've updated my answer. Please check.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 15:09:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476551#M81806</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-03T15:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the sourcetype set as filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476552#M81807</link>
      <description>&lt;P&gt;That didn't seem to work, I still get some that are filename as sourcetype and too_small on some as well&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 18:48:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476552#M81807</guid>
      <dc:creator>tkw03</dc:creator>
      <dc:date>2020-03-03T18:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the sourcetype set as filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476553#M81808</link>
      <description>&lt;P&gt;Got it working.&lt;/P&gt;

&lt;P&gt;I separated out the inputs like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log/remote/.../messages/]
whitelist=(messages.log)
blacklist=(\.bz2$)
index=nix_os
sourcetype = syslog
disabled = 0
recursive=true
crcSalt = &amp;lt;SOURCE&amp;gt;


[monitor:///var/log/remote/.../messages/archive/]
whitelist=(messages.log)
blacklist=(\.bz2$)
index=nix_os
sourcetype = syslog
disabled = 0
recursive=true
crcSalt = &amp;lt;SOURCE&amp;gt;


[monitor:///var/log/remote/.../audisp/]
whitelist=(audisp.log)
blacklist=(\.bz2$)
index=nix_os
sourcetype = linux:audit
disabled = 0
recursive=true
crcSalt = &amp;lt;SOURCE&amp;gt;


[monitor:///var/log/remote/.../audisp/archive/]
whitelist=(audisp.log)
blacklist=(\.bz2$)
index=nix_os
sourcetype = linux:audit
disabled = 0
recursive=true
crcSalt = &amp;lt;SOURCE&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;along with the props and transforms above.&lt;/P&gt;

&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 17:29:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-sourcetype-set-as-filename/m-p/476553#M81808</guid>
      <dc:creator>tkw03</dc:creator>
      <dc:date>2020-03-05T17:29:31Z</dc:date>
    </item>
  </channel>
</rss>

