<?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: Index past logs under one source in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69889#M97049</link>
    <description>&lt;P&gt;If you're just setting the source to a static value, you can do it via transforms, as kristian.kolb suggested, but it might be simpler to just do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///my/log/path/BEK*.log]
sourcetype=BEKlogs
source=BEK.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, if you're going to do that, I might just suggest you ignore "source" and use "sourcetype" anyway. If on the other hand, you want to preserve part of the source path, e.g., you are monitoring files like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///my/path/*/logs/BEK*.log]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and you want the source to read like &lt;CODE&gt;/my/path/group1/logs/BEK.log&lt;/CODE&gt;, you would use kristian's method of a transform, but you would need a more complex REGEX and FORMAT to extract and use the appropriate parts of the source you want.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2013 16:17:26 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2013-03-21T16:17:26Z</dc:date>
    <item>
      <title>Index past logs under one source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69884#M97044</link>
      <description>&lt;P&gt;I was wondering:  Is there a way to index past logs and still have them show up as just one source?&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;P&gt;I have a directory with a bunch of logs in it.  They look like:&lt;/P&gt;

&lt;P&gt;BEK02132013.log&lt;BR /&gt;
BEK02142013.log&lt;BR /&gt;
BEK02152013.log&lt;BR /&gt;
BEK02162013.log&lt;BR /&gt;
BEK02172013.log&lt;BR /&gt;
BEK02182013.log&lt;BR /&gt;
....&lt;BR /&gt;
....&lt;BR /&gt;
etc., etc.,&lt;/P&gt;

&lt;P&gt;So a new log is made every day with the date in it.  This means if I setup a monitor inputs for this directory, all the files are indexed.  They all show up as a source and this makes my source list huge!&lt;/P&gt;

&lt;P&gt;Considering there are timestamps in the logs, I was wondering is there a way for all these logs to just be under one source?  Example:  All this data is under the source BEK.log.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 14:03:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69884#M97044</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2013-03-21T14:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Index past logs under one source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69885#M97045</link>
      <description>&lt;P&gt;Yes, that can be done, but it will not alter already indexed data, just new stuff coming in.&lt;/P&gt;

&lt;P&gt;Assuming you have an &lt;CODE&gt;inputs.conf&lt;/CODE&gt; that looks like this;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/logs/BEKLOGS]
index = blah
sourcetype = bek
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you would want to have a &lt;CODE&gt;props.conf&lt;/CODE&gt; entry like this;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[bek]
TRANSFORMS-foo = set_bek_source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and a &lt;CODE&gt;transforms.conf&lt;/CODE&gt; like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[set_bek_source]
REGEX = .
DEST_KEY = MetaData:Source
FORMAT = source::BEK.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For more examples, see:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/5544/override-source-tcpxxxx-of-a-tcp-input-using-transforms"&gt;http://splunk-base.splunk.com/answers/5544/override-source-tcpxxxx-of-a-tcp-input-using-transforms&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Admin/Transformsconf"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/Admin/Transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 14:44:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69885#M97045</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-03-21T14:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Index past logs under one source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69886#M97046</link>
      <description>&lt;P&gt;Ok i will try this.  I assumed it used transforms but wasn't sure the exact way to go about it.  Let me test this.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 15:23:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69886#M97046</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2013-03-21T15:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Index past logs under one source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69887#M97047</link>
      <description>&lt;P&gt;I have the inputs on the forwarder and made entries in props.conf and transforms.conf on the indexer.  So far don't have the logs showing up but will look at things.  I  had a crc salt error so i added crcsalt = &lt;SOURCE&gt; and now it's working!  Thanks so much for your assistance.&lt;/SOURCE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 15:52:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69887#M97047</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2013-03-21T15:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Index past logs under one source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69888#M97048</link>
      <description>&lt;P&gt;just to clarify; if you use a heavy forwarder, the props and transforms should go there and not on the indexer.&lt;/P&gt;

&lt;P&gt;For universal or lightweight forwarder, the settings should be on the indexer.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 15:59:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69888#M97048</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-03-21T15:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Index past logs under one source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69889#M97049</link>
      <description>&lt;P&gt;If you're just setting the source to a static value, you can do it via transforms, as kristian.kolb suggested, but it might be simpler to just do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///my/log/path/BEK*.log]
sourcetype=BEKlogs
source=BEK.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, if you're going to do that, I might just suggest you ignore "source" and use "sourcetype" anyway. If on the other hand, you want to preserve part of the source path, e.g., you are monitoring files like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///my/path/*/logs/BEK*.log]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and you want the source to read like &lt;CODE&gt;/my/path/group1/logs/BEK.log&lt;/CODE&gt;, you would use kristian's method of a transform, but you would need a more complex REGEX and FORMAT to extract and use the appropriate parts of the source you want.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 16:17:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69889#M97049</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-03-21T16:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Index past logs under one source</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69890#M97050</link>
      <description>&lt;P&gt;aah, I knew there was a simpler way... just never done much of source overriding, just index, host etc.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2013 16:29:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-past-logs-under-one-source/m-p/69890#M97050</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-03-21T16:29:34Z</dc:date>
    </item>
  </channel>
</rss>

