<?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: Create index when forward event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459540#M168040</link>
    <description>&lt;P&gt;Example messages: &lt;BR /&gt;
{ "name":"value1"} ,&lt;BR /&gt;
  {"name":"value2"},&lt;BR /&gt;
....&lt;BR /&gt;
 {"name":"valueN"}&lt;/P&gt;

&lt;P&gt;The main issue: Is it possible splunk automatically to create indexes with name "value1","value2",... if they does not exist and after that forward messages to that index. &lt;/P&gt;</description>
    <pubDate>Tue, 31 Jul 2018 13:46:57 GMT</pubDate>
    <dc:creator>stefanosnadal</dc:creator>
    <dc:date>2018-07-31T13:46:57Z</dc:date>
    <item>
      <title>Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459536#M168036</link>
      <description>&lt;P&gt;Is it possible to create index when forward event to the indexer, by extracting value of the field. And this value to be the name of the index?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 12:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459536#M168036</guid>
      <dc:creator>stefanosnadal</dc:creator>
      <dc:date>2018-07-30T12:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459537#M168037</link>
      <description>&lt;P&gt;If you know the value of the field beforehand, using &lt;CODE&gt;props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt;, you can achieve this. Please provide some sample data to perform regex matching and your use case with examples. Otherwise, below is the basic structure of configuration settings for routing events.&lt;/P&gt;

&lt;P&gt;Props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_custom_sourcetype]
TRANSFORMS-routing = routing_based_on_field_values
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[routing_based_on_field_values]
REGEX = &amp;lt;your_custom_regex&amp;gt;
DEST_KEY = _MetaData:Index
FORMAT = &amp;lt;field_value_for_index_name&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can find more information in below links, let me know if this helps.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.2/Indexer/Setupmultipleindexes#Route_specific_events_to_a_different_index"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.2/Indexer/Setupmultipleindexes#Route_specific_events_to_a_different_index&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/566448/route-specific-events-to-a-relative-index.html"&gt;https://answers.splunk.com/answers/566448/route-specific-events-to-a-relative-index.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 17:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459537#M168037</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-07-30T17:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459538#M168038</link>
      <description>&lt;P&gt;I'm using this approach, but my idea is to create an index before forwarding. In my case the value of the index is part of the message , but it isn't known and I want to create an index with the same value from the message if it doesn't exist.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 05:40:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459538#M168038</guid>
      <dc:creator>stefanosnadal</dc:creator>
      <dc:date>2018-07-31T05:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459539#M168039</link>
      <description>&lt;P&gt;I think we can try modifying transforms.conf a little and see if it works. Can you provide some sample events and tell me what value should be extracted. &lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 13:35:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459539#M168039</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-07-31T13:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459540#M168040</link>
      <description>&lt;P&gt;Example messages: &lt;BR /&gt;
{ "name":"value1"} ,&lt;BR /&gt;
  {"name":"value2"},&lt;BR /&gt;
....&lt;BR /&gt;
 {"name":"valueN"}&lt;/P&gt;

&lt;P&gt;The main issue: Is it possible splunk automatically to create indexes with name "value1","value2",... if they does not exist and after that forward messages to that index. &lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 13:46:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459540#M168040</guid>
      <dc:creator>stefanosnadal</dc:creator>
      <dc:date>2018-07-31T13:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459541#M168041</link>
      <description>&lt;P&gt;No, I don't believe Splunk has the functionality to create a 'missing' index on the fly. Of course you can script anything, so you can also create a saved search that triggers on "received event for unknown index X" errors in the internal logs, which kicks off a script that creates index X. But then at least the first few events will not end up in that index.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 13:53:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459541#M168041</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-07-31T13:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459542#M168042</link>
      <description>&lt;P&gt;Okey, thanks for the help.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 14:00:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459542#M168042</guid>
      <dc:creator>stefanosnadal</dc:creator>
      <dc:date>2018-07-31T14:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459543#M168043</link>
      <description>&lt;P&gt;Give this a try. I did not test it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[routing_based_on_field_values]
REGEX = \{\s?\"(name)\"\:\"(\w+)\"\}
DEST_KEY = _MetaData:Index
FORMAT = $2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Jul 2018 14:03:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459543#M168043</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-07-31T14:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459544#M168044</link>
      <description>&lt;P&gt;This is used if you have already created the index and you want to forward message to that index. &lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 14:07:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459544#M168044</guid>
      <dc:creator>stefanosnadal</dc:creator>
      <dc:date>2018-07-31T14:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459545#M168045</link>
      <description>&lt;P&gt;Actually, the value in the 2nd ($2) capturing group in REGEX is assigned as index value because, DEST_KEY specifies where Splunk stores the expanded FORMAT results in accordance with the REGEX match. Be sure to push these changes to UF, HF (if any) and indexers. &lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 14:28:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459545#M168045</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-07-31T14:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459546#M168046</link>
      <description>&lt;P&gt;That still does not help him for the case where that index doesn't exist yet. That's his whole point. How to dynamically create a new index based on event content.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 14:52:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459546#M168046</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-07-31T14:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create index when forward event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459547#M168047</link>
      <description>&lt;P&gt;Agreed! That's why I started my answer with "If you know the value of the field beforehand". But I wanted to see if there are any other possible solutions before giving up. Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 16:22:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-index-when-forward-event/m-p/459547#M168047</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-07-31T16:22:28Z</dc:date>
    </item>
  </channel>
</rss>

