<?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 How to filter data from a single file and write to two different indexes? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513371#M87059</link>
    <description>&lt;P&gt;I am trying to filter a set of data from a single file with the below conditions and send the filtered data to different indexes.&lt;/P&gt;&lt;P&gt;Events are like: [ file.txt]&lt;/P&gt;&lt;P&gt;&amp;lt;85&amp;gt;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;/P&gt;&lt;P&gt;&amp;lt;25&amp;gt;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;/P&gt;&lt;P&gt;So, event with 85 one should go to index A&lt;/P&gt;&lt;P&gt;and 25 one should go to index B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Aug 2020 14:36:31 GMT</pubDate>
    <dc:creator>payal23</dc:creator>
    <dc:date>2020-08-10T14:36:31Z</dc:date>
    <item>
      <title>How to filter data from a single file and write to two different indexes?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513371#M87059</link>
      <description>&lt;P&gt;I am trying to filter a set of data from a single file with the below conditions and send the filtered data to different indexes.&lt;/P&gt;&lt;P&gt;Events are like: [ file.txt]&lt;/P&gt;&lt;P&gt;&amp;lt;85&amp;gt;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;/P&gt;&lt;P&gt;&amp;lt;25&amp;gt;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;/P&gt;&lt;P&gt;So, event with 85 one should go to index A&lt;/P&gt;&lt;P&gt;and 25 one should go to index B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 14:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513371#M87059</guid>
      <dc:creator>payal23</dc:creator>
      <dc:date>2020-08-10T14:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data from a single file and write to two different indexes?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513379#M87061</link>
      <description>&lt;P&gt;create props.conf On HF or Indexer&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; you should change [&lt;STRONG&gt;currentsourcetype&lt;/STRONG&gt;] below with your sourcetype events are coming in.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[currentsourcetype]
TRANSFORMS-routetoindexes = firstindex, secondindex&lt;/LI-CODE&gt;&lt;P&gt;transforms.conf on same HF or Indexers&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[firstindex]
REGEX = ^\&amp;lt;85\&amp;gt; 
#to change index if event matches with the above regex
DEST_KEY = _MetaData:Index 
#indexA is index where matching data will be indexed
FORMAT = indexA

[secondindex]
REGEX = ^\&amp;lt;25\&amp;gt;
#to change index if event matches with the above regex
DEST_KEY = _MetaData:Index 
#indexA is index where matching data will be indexed
FORMAT = indexB&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 15:43:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513379#M87061</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-10T15:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data from a single file and write to two different indexes?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513383#M87064</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt; I will try this. And which index i should write in inputs.conf (Splunk UF integration) as Splunk will be monitoring the same file.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 15:34:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513383#M87064</guid>
      <dc:creator>payal23</dc:creator>
      <dc:date>2020-08-10T15:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data from a single file and write to two different indexes?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513389#M87066</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/167362"&gt;@payal23&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you can give any index based on your requirement, if you give different index other than indexA and indexB used in transforms, you will be ending up with total 3 indexes for same input. hope this clears your doubt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;up vote if my solution works for you.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 15:46:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513389#M87066</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-10T15:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data from a single file and write to two different indexes?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513487#M87077</link>
      <description>&lt;P&gt;Thanks for the explanation &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;.. and its working!!! I added WRITE_META=true as well.&lt;/P&gt;&lt;P&gt;I have one more question: This configuration will work in both HF and Indexer, so which one should i use for this scenario?&lt;/P&gt;&lt;P&gt;Read this link and so I am confused: &lt;A href="https://aditumpartners.com/5-splunk-myths-busted/" target="_blank"&gt;https://aditumpartners.com/5-splunk-myths-busted/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 03:43:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513487#M87077</guid>
      <dc:creator>payal23</dc:creator>
      <dc:date>2020-08-11T03:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter data from a single file and write to two different indexes?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513525#M87082</link>
      <description>&lt;P&gt;Data flow between universal forwarder and Indexer&lt;/P&gt;&lt;P&gt;universal forwarder -&amp;gt; Heavy forwarder(optional) -&amp;gt; Indexer&lt;/P&gt;&lt;P&gt;if you have heavy forwarder in place, I recommend using HF because the purpose of placing HF in between UF and Indexer is to parse/clean the data. Indexer is busy in serving requests coming from Search Head.&lt;/P&gt;&lt;P&gt;if you don't have HF in the flow , you can apply on Indexer.&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;&lt;P&gt;up vote, if it solves your issue.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 08:51:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-two-different/m-p/513525#M87082</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-08-11T08:51:24Z</dc:date>
    </item>
  </channel>
</rss>

