<?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 Route and filter data that is received only from certain index from tcp 9997 port in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Route-and-filter-data-that-is-received-only-from-certain-index/m-p/553667#M91791</link>
    <description>&lt;P&gt;Based on this&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.0/Forwarding/Routeandfilterdatad#Filter_data_by_target_index" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.0/Forwarding/Routeandfilterdatad#Filter_data_by_target_index&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have identified the method&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mw-headline"&gt;Keep specific events and discard the rest&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Keeping only some events and discarding the rest requires two transforms. In this scenario, which is opposite of the previous, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setnull&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;transform routes all events to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;nullQueue&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;while the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setparsing&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;transform selects the sshd events and sends them on to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;indexQueue.&lt;/P&gt;&lt;P&gt;As with other index-time field extractions, processing of transforms happens in the order that you specify them, from left to right. The key difference is the order in which you specify the stanzas. In this example, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setnull&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;stanza must appear first in the list. This is because if you set it last, it matches all events and sends them to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;nullQueue, and as it is the last transform, it effectively throws all of the events away, even those that previously matched the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setparsing&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;stanza.&lt;/P&gt;&lt;P&gt;When you set the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setnull&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;transform first, it matches all events and tags them to be sent to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;nullQueue. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setparsing&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;transform then follows, and tags events that match&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[sshd]&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to go to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;indexQueue. The result is that the events that contain&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[sshd]&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;get passed on, while all other events get dropped.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;DIV class="li_content"&gt;Edit&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;props.conf&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and add the following:&lt;PRE&gt;[source:splunk://tcp:9997]
TRANSFORMS-set= setnull,setparsing&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="li_content"&gt;Edit&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;transforms.conf&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and add the following:&lt;PRE&gt;[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = \[sshd\]
DEST_KEY = queue
FORMAT = indexQueue&lt;/PRE&gt;&lt;P&gt;What will be the regex if I want to regex by index?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I am receiving a copy from the event from a external Splunk indexer, and wish to filter the data out, before the data reach my Splunk indexer&lt;/P&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
    <pubDate>Sun, 30 May 2021 17:58:39 GMT</pubDate>
    <dc:creator>z080236</dc:creator>
    <dc:date>2021-05-30T17:58:39Z</dc:date>
    <item>
      <title>Route and filter data that is received only from certain index from tcp 9997 port</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-and-filter-data-that-is-received-only-from-certain-index/m-p/553667#M91791</link>
      <description>&lt;P&gt;Based on this&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.0/Forwarding/Routeandfilterdatad#Filter_data_by_target_index" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.0/Forwarding/Routeandfilterdatad#Filter_data_by_target_index&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have identified the method&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mw-headline"&gt;Keep specific events and discard the rest&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Keeping only some events and discarding the rest requires two transforms. In this scenario, which is opposite of the previous, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setnull&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;transform routes all events to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;nullQueue&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;while the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setparsing&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;transform selects the sshd events and sends them on to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;indexQueue.&lt;/P&gt;&lt;P&gt;As with other index-time field extractions, processing of transforms happens in the order that you specify them, from left to right. The key difference is the order in which you specify the stanzas. In this example, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setnull&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;stanza must appear first in the list. This is because if you set it last, it matches all events and sends them to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;nullQueue, and as it is the last transform, it effectively throws all of the events away, even those that previously matched the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setparsing&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;stanza.&lt;/P&gt;&lt;P&gt;When you set the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setnull&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;transform first, it matches all events and tags them to be sent to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;nullQueue. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;setparsing&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;transform then follows, and tags events that match&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[sshd]&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to go to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;indexQueue. The result is that the events that contain&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[sshd]&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;get passed on, while all other events get dropped.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;DIV class="li_content"&gt;Edit&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;props.conf&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and add the following:&lt;PRE&gt;[source:splunk://tcp:9997]
TRANSFORMS-set= setnull,setparsing&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="li_content"&gt;Edit&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;transforms.conf&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and add the following:&lt;PRE&gt;[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = \[sshd\]
DEST_KEY = queue
FORMAT = indexQueue&lt;/PRE&gt;&lt;P&gt;What will be the regex if I want to regex by index?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I am receiving a copy from the event from a external Splunk indexer, and wish to filter the data out, before the data reach my Splunk indexer&lt;/P&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Sun, 30 May 2021 17:58:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-and-filter-data-that-is-received-only-from-certain-index/m-p/553667#M91791</guid>
      <dc:creator>z080236</dc:creator>
      <dc:date>2021-05-30T17:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Route and filter data that is received only from certain index from tcp 9997 port</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Route-and-filter-data-that-is-received-only-from-certain-index/m-p/553688#M91792</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option1: Try like below to push to an index&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[setparsing]
REGEX=\[sshd\]
DEST_KEY=_MetaData:Index
FORMAT=my_new_index&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option2: Another idea to try out is to&amp;nbsp; ensure, the `sshd` type of data&amp;nbsp; have a new sourcetype&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[setparsing]
REGEX = \[sshd\]
FORMAT = sourcetype::mycustom:linux:sshd
DEST_KEY = MetaData:Sourcetype&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then in your props.conf. This way you can group relevant data into sourcetype which can then be pushed to relevant index&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 07:12:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Route-and-filter-data-that-is-received-only-from-certain-index/m-p/553688#M91792</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2021-05-31T07:12:01Z</dc:date>
    </item>
  </channel>
</rss>

