<?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: Heavyforwarder transforms.conf split data into multiple indexes in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Heavyforwarder-transforms-conf-split-data-into-multiple-indexes/m-p/396426#M70654</link>
    <description>&lt;P&gt;The problem is that the "discardAll" changes the queue for all messages, so all messages are dropped. Changing the index for the messages you want to keep doesn't change the queue back from null queue.&lt;/P&gt;

&lt;P&gt;So you need 2 additional transforms (or combine the 2 regexes to do it in one):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[queue_one] 
REGEX=(First_Filter)
DEST_KEY=queue
FORMAT=indexQueue

[queue_two] 
REGEX=(Second_Variant)
DEST_KEY=queue
FORMAT=indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then of course update your props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Custom_S]
TRANSFORMS-set = discardAll,queue_one,queue_two,index2one,index2two
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 25 Feb 2019 08:32:46 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2019-02-25T08:32:46Z</dc:date>
    <item>
      <title>Heavyforwarder transforms.conf split data into multiple indexes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Heavyforwarder-transforms-conf-split-data-into-multiple-indexes/m-p/396425#M70653</link>
      <description>&lt;P&gt;Hello experts,&lt;/P&gt;

&lt;P&gt;Need help. My requirement is to extract 1st set of lines into 1st index and 2nd set into 2nd index. And ignore all other lines from a log file.&lt;/P&gt;

&lt;P&gt;Below is my configuration which is obviously failing. &lt;/P&gt;

&lt;P&gt;I have seen other blogs' solution - successfully able to separate events into two indexes without using [discardAll] from transforms.conf and unspecified index in inputs.conf. But it will redirect all my ignored lines into main idx which I don't want.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;inputs.conf&lt;/STRONG&gt;&lt;BR /&gt;
[monitor://D:\splunk_test\target.log]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
sourcetype = Custom_S&lt;BR /&gt;
index = target_index_one&lt;BR /&gt;
interval = 10&lt;BR /&gt;
crcSalt = &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;BR /&gt;
[Custom_S]&lt;BR /&gt;
TRANSFORMS-set = discardAll,index2one,index2two&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;BR /&gt;
[discardAll]&lt;BR /&gt;
REGEX=.&lt;BR /&gt;
DEST_KEY=queue&lt;BR /&gt;
FORMAT=nullQueue&lt;/P&gt;

&lt;P&gt;[index2one] &lt;BR /&gt;
REGEX=(First_Filter)&lt;BR /&gt;
DEST_KEY=_MetaData:Index&lt;BR /&gt;
FORMAT=target_index_one&lt;/P&gt;

&lt;P&gt;[index2two] &lt;BR /&gt;
REGEX=(Second_Variant)&lt;BR /&gt;
DEST_KEY=_MetaData:Index&lt;BR /&gt;
FORMAT=target_index_two&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:20:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Heavyforwarder-transforms-conf-split-data-into-multiple-indexes/m-p/396425#M70653</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2020-09-29T23:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Heavyforwarder transforms.conf split data into multiple indexes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Heavyforwarder-transforms-conf-split-data-into-multiple-indexes/m-p/396426#M70654</link>
      <description>&lt;P&gt;The problem is that the "discardAll" changes the queue for all messages, so all messages are dropped. Changing the index for the messages you want to keep doesn't change the queue back from null queue.&lt;/P&gt;

&lt;P&gt;So you need 2 additional transforms (or combine the 2 regexes to do it in one):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[queue_one] 
REGEX=(First_Filter)
DEST_KEY=queue
FORMAT=indexQueue

[queue_two] 
REGEX=(Second_Variant)
DEST_KEY=queue
FORMAT=indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then of course update your props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Custom_S]
TRANSFORMS-set = discardAll,queue_one,queue_two,index2one,index2two
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Feb 2019 08:32:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Heavyforwarder-transforms-conf-split-data-into-multiple-indexes/m-p/396426#M70654</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-02-25T08:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Heavyforwarder transforms.conf split data into multiple indexes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Heavyforwarder-transforms-conf-split-data-into-multiple-indexes/m-p/396427#M70655</link>
      <description>&lt;P&gt;Just Awesome. I should have asked this before scratching my head for half a day and trying multiple options with transforms.conf and eventually failing.&lt;/P&gt;

&lt;P&gt;Thanks Frank&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 23:55:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Heavyforwarder-transforms-conf-split-data-into-multiple-indexes/m-p/396427#M70655</guid>
      <dc:creator>nareshinsvu</dc:creator>
      <dc:date>2019-02-25T23:55:08Z</dc:date>
    </item>
  </channel>
</rss>

