<?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: Using Splunk heavy forwarder - Filter data before TCP routing - What's wrong with my configuration? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318547#M59539</link>
    <description>&lt;P&gt;Try to reverse order in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csi_pclog]
TRANSFORMS-routing= itseccsiappDiscard,itseccsiappRouting
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then restart Splunk on HF&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2017 17:21:06 GMT</pubDate>
    <dc:creator>harsmarvania57</dc:creator>
    <dc:date>2017-10-19T17:21:06Z</dc:date>
    <item>
      <title>Using Splunk heavy forwarder - Filter data before TCP routing - What's wrong with my configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318546#M59538</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm using a Splunk Heavy Forwarder with props.conf, transforms.conf and outputs.conf to selectively send events to different splunk Indexers based on the sourcetype. That works well.&lt;/P&gt;

&lt;P&gt;But now I have a new need: For a specific sourcetype (csi_pclog), I need to get rid of most events first, then route remaining events to a specific indexer. For some reason, I'm having trouble making this work. I'm not receiving any events and I've checked in the actual file I'm forwarding - there's data in there.&lt;/P&gt;

&lt;P&gt;Basically all events for sourcetype=csi_pclog need to be dropped, except events with the word "Login". Here's what I have:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;P&gt;[csi_pclog]&lt;BR /&gt;
TRANSFORMS-routing=itseccsiappRouting, itseccsiappDiscard&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;P&gt;[itseccsiappDiscard]&lt;BR /&gt;
REGEX=.&lt;BR /&gt;
DEST_KEY= queue&lt;BR /&gt;
FORMAT=nullQueue&lt;/P&gt;

&lt;P&gt;[itseccsiappRouting]&lt;BR /&gt;
REGEX=Login&lt;BR /&gt;
DEST_KEY=_TCP_ROUTING&lt;BR /&gt;
FORMAT=default-autolb-group&lt;/P&gt;

&lt;P&gt;outputs.conf&lt;/P&gt;

&lt;P&gt;[tcpout]&lt;BR /&gt;
defaultGroup = default-autolb-group&lt;BR /&gt;
forwardedindex.3.whitelist = (_audit|_internal|_introspection|_telemetry)&lt;/P&gt;

&lt;P&gt;[tcpout:default-autolb-group]&lt;BR /&gt;
server = indexer1:9997&lt;/P&gt;

&lt;P&gt;[tcpout-server://indexer1:9997]&lt;/P&gt;

&lt;P&gt;[tcpout:itsechf]&lt;BR /&gt;
server = indexer2:9997&lt;/P&gt;

&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:20:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318546#M59538</guid>
      <dc:creator>patouellet</dc:creator>
      <dc:date>2020-09-29T16:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using Splunk heavy forwarder - Filter data before TCP routing - What's wrong with my configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318547#M59539</link>
      <description>&lt;P&gt;Try to reverse order in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csi_pclog]
TRANSFORMS-routing= itseccsiappDiscard,itseccsiappRouting
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then restart Splunk on HF&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 17:21:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318547#M59539</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2017-10-19T17:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using Splunk heavy forwarder - Filter data before TCP routing - What's wrong with my configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318548#M59540</link>
      <description>&lt;P&gt;Thanks for the reply. Tried it, no change. Still not getting events. I see the connection being established between the client and the HF, so it has to be my props/transforms/outputs combination that aren't quite right.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 19:18:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318548#M59540</guid>
      <dc:creator>patouellet</dc:creator>
      <dc:date>2017-10-19T19:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using Splunk heavy forwarder - Filter data before TCP routing - What's wrong with my configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318549#M59541</link>
      <description>&lt;P&gt;If you refer to &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/Forwarding/Routeandfilterdatad"&gt;route and filter data&lt;/A&gt; you probably want to do (quoting from the documentation):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(1) Edit props.conf and add the following:

[source::/var/log/messages]
TRANSFORMS-set= setnull,setparsing

(2) Edit transforms.conf and add the following:
[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = \[sshd\]
DEST_KEY = queue
FORMAT = indexQueue

(3) Restart Splunk Enterprise.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In other words you want to change the &lt;EM&gt;queue&lt;/EM&gt; not the routing when you want to include the data you previously sent to the null queue...&lt;/P&gt;

&lt;P&gt;Right now you do appear to be dropping &lt;EM&gt;everything&lt;/EM&gt; to the null queue so no data will be sent at all.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 19:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318549#M59541</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2017-10-19T19:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using Splunk heavy forwarder - Filter data before TCP routing - What's wrong with my configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318550#M59542</link>
      <description>&lt;P&gt;Thanks for the reply. I kinda get what you are saying, I think. But I'm not indexing on this HF, I want to send it to a specific tcpout group. &lt;/P&gt;

&lt;P&gt;Let's say I do what you suggest, the events will go to the default output group, right? How to I tell it to route to a different group?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 19:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318550#M59542</guid>
      <dc:creator>patouellet</dc:creator>
      <dc:date>2017-10-19T19:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using Splunk heavy forwarder - Filter data before TCP routing - What's wrong with my configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318551#M59543</link>
      <description>&lt;P&gt;There is likely more than one way to do this but why not specify in your inputs.conf the _TCP_ROUTING =  setting? This way you can send the data to the correct TCP output.&lt;/P&gt;

&lt;P&gt;Since the transforms.conf you have will drop everything to the null queue by default, you can use your second regular expression (Login) to ensure that data gets forwarded (and since the inputs.conf has already specified which TCP output queue you are using you won't need to override in the transforms.conf).&lt;/P&gt;

&lt;P&gt;In terms of config:&lt;BR /&gt;
props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csi_pclog]
TRANSFORMS-routing=itseccsiappDiscard,itseccsiappRouting
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[itseccsiappDiscard]
REGEX=.
DEST_KEY= queue
FORMAT=nullQueue

[itseccsiappRouting]
REGEX=Login
DEST_KEY=queue
FORMAT=indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In your inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;yourstanza&amp;gt;]
_TCP_ROUTING = itsechf
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:18:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318551#M59543</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2020-09-29T16:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using Splunk heavy forwarder - Filter data before TCP routing - What's wrong with my configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318552#M59544</link>
      <description>&lt;P&gt;Or do multiple transforms to change the routing and the discard/include data if you prefer...&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 10:48:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318552#M59544</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2017-10-20T10:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using Splunk heavy forwarder - Filter data before TCP routing - What's wrong with my configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318553#M59545</link>
      <description>&lt;P&gt;Think I would prefer the multiple transforms option. Care to help again? Never done it, unsure what do do.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 11:06:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318553#M59545</guid>
      <dc:creator>patouellet</dc:creator>
      <dc:date>2017-10-20T11:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using Splunk heavy forwarder - Filter data before TCP routing - What's wrong with my configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318554#M59546</link>
      <description>&lt;P&gt;garethatiag answer was key to figuring this out. The full working config is:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csi_pclog]
TRANSFORMS-routing=itseccsiappDiscard,itseccsiappKeep, itseccsiappRouting
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[itseccsiappDiscard]
REGEX= .
DEST_KEY= queue
FORMAT=nullQueue

[itseccsiappKeep]
REGEX=Login
DEST_KEY=queue
FORMAT=indexQueue

[itseccsiappRouting]
REGEX= .
DEST_KEY=_TCP_ROUTING
FORMAT=itsechf
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Oct 2017 19:58:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-Splunk-heavy-forwarder-Filter-data-before-TCP-routing-What/m-p/318554#M59546</guid>
      <dc:creator>patouellet</dc:creator>
      <dc:date>2017-10-27T19:58:13Z</dc:date>
    </item>
  </channel>
</rss>

