<?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 Dynamic sourcetype based on source not working in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Dynamic-sourcetype-based-on-source-not-working/m-p/286754#M54758</link>
    <description>&lt;P&gt;I'm trying to set sourcetype based on a regex from the source path during indexing, and it is not working.&lt;BR /&gt;
What am I doing wrong?&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/var/log/docker/...]
TRANSFORMS-setsourcetype = setsourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setsourcetype]
SOURCE_KEY = source
REGEX = ^\/var\/log\/docker\/[^\/]*\/([^\/]*)
FORMAT = sourcetype::$1
DEST_KEY = MetaData:Sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 03 Jun 2016 18:43:35 GMT</pubDate>
    <dc:creator>davebo1896</dc:creator>
    <dc:date>2016-06-03T18:43:35Z</dc:date>
    <item>
      <title>Dynamic sourcetype based on source not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Dynamic-sourcetype-based-on-source-not-working/m-p/286754#M54758</link>
      <description>&lt;P&gt;I'm trying to set sourcetype based on a regex from the source path during indexing, and it is not working.&lt;BR /&gt;
What am I doing wrong?&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/var/log/docker/...]
TRANSFORMS-setsourcetype = setsourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setsourcetype]
SOURCE_KEY = source
REGEX = ^\/var\/log\/docker\/[^\/]*\/([^\/]*)
FORMAT = sourcetype::$1
DEST_KEY = MetaData:Sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jun 2016 18:43:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Dynamic-sourcetype-based-on-source-not-working/m-p/286754#M54758</guid>
      <dc:creator>davebo1896</dc:creator>
      <dc:date>2016-06-03T18:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sourcetype based on source not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Dynamic-sourcetype-based-on-source-not-working/m-p/286755#M54759</link>
      <description>&lt;P&gt;The &lt;CODE&gt;SOURCE_KEY&lt;/CODE&gt; should be &lt;CODE&gt;MetaData:Source&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Ensure, the configurations are deployed in first full SPlunk instance (heavy forwarder OR indexer)&lt;/P&gt;

&lt;P&gt;If it still doesn't work, try &lt;CODE&gt;[source::/var/log/docker/*]&lt;/CODE&gt; instead of &lt;CODE&gt;[source::/var/log/docker/...]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 20:09:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Dynamic-sourcetype-based-on-source-not-working/m-p/286755#M54759</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-03T20:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sourcetype based on source not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Dynamic-sourcetype-based-on-source-not-working/m-p/286756#M54760</link>
      <description>&lt;P&gt;I changed props to [source::/var/log/docker/&lt;EM&gt;/&lt;/EM&gt;] and verified it is working by adding a SEDCMD.&lt;/P&gt;

&lt;P&gt;SOURCE_KEY = MetaData:Source is not working in transforms.conf  (I think that should technically be the correct solution, though)&lt;/P&gt;

&lt;P&gt;I'll put in a ticket with Splunk support and report back here what we find out.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 21:01:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Dynamic-sourcetype-based-on-source-not-working/m-p/286756#M54760</guid>
      <dc:creator>davebo1896</dc:creator>
      <dc:date>2016-06-03T21:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic sourcetype based on source not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Dynamic-sourcetype-based-on-source-not-working/m-p/286757#M54761</link>
      <description>&lt;P&gt;Looks like there may be stray characters on the value of source.  I added global matches on either end of the source value and now it is parsing fine.  &lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
    [source::/var/log/docker/&lt;EM&gt;/&lt;/EM&gt;]&lt;BR /&gt;
    TRANSFORMS-setsourcetype_from_source = setsourcetype_from_source&lt;/P&gt;

&lt;P&gt;transforms.conf:&lt;BR /&gt;
    [setsourcetype_from_source]&lt;BR /&gt;
    DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;
    SOURCE_KEY = MetaData:Source&lt;BR /&gt;
    REGEX = .*\/var\/log\/docker\/[^\/]+\/([^\/]+).*&lt;BR /&gt;
    FORMAT = sourcetype::$1&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:51:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Dynamic-sourcetype-based-on-source-not-working/m-p/286757#M54761</guid>
      <dc:creator>davebo1896</dc:creator>
      <dc:date>2020-09-29T09:51:44Z</dc:date>
    </item>
  </channel>
</rss>

