<?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: Control number of sources with rotated logfiles in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71195#M180807</link>
    <description>&lt;P&gt;You could try the following in your props.conf file to specify a sourcetype based on the file's naming convention:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/depot/logs/file_*.log]
sourcetype = foo
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 15 Oct 2010 20:11:47 GMT</pubDate>
    <dc:creator>williamche</dc:creator>
    <dc:date>2010-10-15T20:11:47Z</dc:date>
    <item>
      <title>Control number of sources with rotated logfiles</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71194#M180806</link>
      <description>&lt;P&gt;I am monitoring a dir with rotating logs, ( fi /depot/logs/ ) how can I control the source name, and avoid zillions of sources. (file_1.log  file_2.log)&lt;/P&gt;

&lt;P&gt;thanks!
Starlette &lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2010 18:02:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71194#M180806</guid>
      <dc:creator>Starlette</dc:creator>
      <dc:date>2010-10-15T18:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Control number of sources with rotated logfiles</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71195#M180807</link>
      <description>&lt;P&gt;You could try the following in your props.conf file to specify a sourcetype based on the file's naming convention:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/depot/logs/file_*.log]
sourcetype = foo
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Oct 2010 20:11:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71195#M180807</guid>
      <dc:creator>williamche</dc:creator>
      <dc:date>2010-10-15T20:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Control number of sources with rotated logfiles</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71196#M180808</link>
      <description>&lt;P&gt;In &lt;CODE&gt;inputs.conf&lt;/CODE&gt;, you can explicitly set the value of &lt;CODE&gt;source&lt;/CODE&gt; for a given input definition:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log/something]
disabled = false
sourcetype = mysourcetype
source = mysource
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or, you can use a transform to assign it in a more targeted way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysourcetype]
DEST_KEY = MetaData:Source
REGEX = (?=)
FORMAT = source::mysource
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above example will always set the source - adjust the &lt;CODE&gt;REGEX&lt;/CODE&gt; setting as needed to match text in your events for a more targeted assignment.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2010 21:05:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71196#M180808</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-10-15T21:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Control number of sources with rotated logfiles</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71197#M180809</link>
      <description>&lt;P&gt;This sets &lt;CODE&gt;sourcetype&lt;/CODE&gt;, not &lt;CODE&gt;source&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2010 21:06:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71197#M180809</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-10-15T21:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Control number of sources with rotated logfiles</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71198#M180810</link>
      <description>&lt;P&gt;ah this looks promising,,,thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2010 23:51:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71198#M180810</guid>
      <dc:creator>Starlette</dc:creator>
      <dc:date>2010-10-15T23:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Control number of sources with rotated logfiles</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71199#M180811</link>
      <description>&lt;P&gt;Just FYI, I've posted several fully functional source renaming transformers in another answer.   (This is using the approach that southeringtonp is talking about.)  Feel free to take a look and see if any of them will work for you:  (Specifically, the transformer name "source_clean-digits-before-ext" looks like it will work for your situation.)&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://answers.splunk.com/questions/3470/consolidate-similarly-named-log-files-into-a-single-source/4420#4420" rel="nofollow"&gt;Consolidate similarly named log files into a single source&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Sat, 16 Oct 2010 03:11:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71199#M180811</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-10-16T03:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Control number of sources with rotated logfiles</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71200#M180812</link>
      <description>&lt;P&gt;Ah, I see what you did there!   I must've read too much into Starlette's questions and thought that all the data from each log file were assigned to a unique sourcetype named after the filename.  It happened to me when I left the sourcetype = automatic.  So I used the method I suggested to overwrite the sourcetype so they are the same for all the rotated log files.  (-2.. I have to make that up somehow!  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; )&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2010 01:04:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Control-number-of-sources-with-rotated-logfiles/m-p/71200#M180812</guid>
      <dc:creator>williamche</dc:creator>
      <dc:date>2010-10-19T01:04:05Z</dc:date>
    </item>
  </channel>
</rss>

