<?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: Route specific events to a relative index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Route-specific-events-to-a-relative-index/m-p/306233#M91948</link>
    <description>&lt;P&gt;I have this working now!  The right reference was $0.  The following statement is working for me&lt;BR /&gt;
&lt;STRONG&gt;FORMAT=$0_2YR&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I found the information at &lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Data/Configureindex-timefieldextraction"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Data/Configureindex-timefieldextraction&lt;/A&gt; &lt;/P&gt;</description>
    <pubDate>Fri, 25 Aug 2017 21:59:17 GMT</pubDate>
    <dc:creator>wayn23</dc:creator>
    <dc:date>2017-08-25T21:59:17Z</dc:date>
    <item>
      <title>Route specific events to a relative index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Route-specific-events-to-a-relative-index/m-p/306232#M91947</link>
      <description>&lt;P&gt;I need to retain events for different periods of time based on content.  I have created indexes with different retentions, for example, audit_1YR, audit_2YR&lt;/P&gt;

&lt;P&gt;I am using the advice in &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.6.3/Indexer/Setupmultipleindexes#Send_events_to_specific_indexes" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.6.3/Indexer/Setupmultipleindexes#Send_events_to_specific_indexes&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I can successfully redirect to different absolute indexes using config like the following on the Indexer&lt;BR /&gt;
&lt;STRONG&gt;$SPLUNK_HOME/etc/system/local/props.conf:&lt;BR /&gt;
[my_sourcetype]&lt;BR /&gt;
TRANSFORMS-index = Retain2Year&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;$SPLUNK_HOME/etc/system/local/transforms.conf:&lt;BR /&gt;
[Retain2Year]&lt;BR /&gt;
REGEX = (2YR)&lt;BR /&gt;
DEST_KEY = _MetaData:Index&lt;BR /&gt;
FORMAT = Audit_2YR&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;What I would like to be able to do is make the new index name be relative to the passed index name set in the Splunk Universal Forwarder, by just suffixing the index name.  For example, something like&lt;BR /&gt;
&lt;STRONG&gt;FORMAT = &lt;EM&gt;existingIndexName&lt;/EM&gt;_2YR&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Is that possible?  How can  the existing index name be referenced in the FORMAT statement?  I have tried the following, which all failed&lt;BR /&gt;
&lt;STRONG&gt;FORMAT = $index.$1&lt;BR /&gt;
FORMAT = index::$index.$1&lt;BR /&gt;
FORMAT = _meta:index.$1&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Route-specific-events-to-a-relative-index/m-p/306232#M91947</guid>
      <dc:creator>wayn23</dc:creator>
      <dc:date>2020-09-29T15:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Route specific events to a relative index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Route-specific-events-to-a-relative-index/m-p/306233#M91948</link>
      <description>&lt;P&gt;I have this working now!  The right reference was $0.  The following statement is working for me&lt;BR /&gt;
&lt;STRONG&gt;FORMAT=$0_2YR&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I found the information at &lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Data/Configureindex-timefieldextraction"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Data/Configureindex-timefieldextraction&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 21:59:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Route-specific-events-to-a-relative-index/m-p/306233#M91948</guid>
      <dc:creator>wayn23</dc:creator>
      <dc:date>2017-08-25T21:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Route specific events to a relative index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Route-specific-events-to-a-relative-index/m-p/306234#M91949</link>
      <description>&lt;P&gt;@wayn23 - We converted your comment to an answer, so you can mark the question as closed by accepting it.  Happy splunking!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 22:20:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Route-specific-events-to-a-relative-index/m-p/306234#M91949</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-25T22:20:44Z</dc:date>
    </item>
  </channel>
</rss>

