Getting Data In

How to edit my configurations to use Heavy Forwarder to filter and route data to another Splunk setup?

meidal_splunkin
New Member

Hi,

I'm trying to use Heavy Forwarders (HF) to route and filter data to another Splunk setup outside of mine. My goal is to send only sourcetype=log4net matching a REGEX (let's say ClientName). I managed to do this but the client requested that I change also the index to where I sent which totally messed up my solution.

Trying to make it short: index=main sourcetype=log4net with ClientName should be routed to the client, index=main sourcetype=iis whatever should not. Any help is deeply appreciated!

###props.conf
[default]
TRANSFORMS-def=clearlog
[log4net]
TRANSFORMS-routing=clearlog,client

###transforms.conf

[clearlog]
REGEX=.
DEST_KEY=queue
FORMAT=nullQueue

[germany]
REGEX=ClientName
DEST_KEY=_MetaData:Index
FORMAT=Clientwtv
0 Karma
1 Solution

somesoni2
Revered Legend

This will be done in two steps.

1) Configure your HF to do the filtering for the sourcetype log4net to send specific events to Third Party Splunk instance (http://docs.splunk.com/Documentation/Splunk/6.5.2/Forwarding/Routeandfilterdatad#Replicate_a_subset_...). I'm guessing this is already done.

2) Change the destination index for this data on the Third party Splunk instance. Now, if you try to override it in your HF, it'll change index name for all events from log4net including it for your events being sent to your Splunk for that sourcetype. So this should be done at the third party Splunk receiver/indexer. Since HF has already parsed it, the third party Splunk instance will not parse it again. To make it do so, use the method defined here. https://answers.splunk.com/answers/97918/reparsing-cooked-data-coming-from-a-heavy-forwarder-possibl... . Then you setup your transforms for overriding index name on third party Splunk instance. https://answers.splunk.com/answers/246672/how-can-i-override-an-index-name-based-on-sourcety.html

View solution in original post

0 Karma

somesoni2
Revered Legend

This will be done in two steps.

1) Configure your HF to do the filtering for the sourcetype log4net to send specific events to Third Party Splunk instance (http://docs.splunk.com/Documentation/Splunk/6.5.2/Forwarding/Routeandfilterdatad#Replicate_a_subset_...). I'm guessing this is already done.

2) Change the destination index for this data on the Third party Splunk instance. Now, if you try to override it in your HF, it'll change index name for all events from log4net including it for your events being sent to your Splunk for that sourcetype. So this should be done at the third party Splunk receiver/indexer. Since HF has already parsed it, the third party Splunk instance will not parse it again. To make it do so, use the method defined here. https://answers.splunk.com/answers/97918/reparsing-cooked-data-coming-from-a-heavy-forwarder-possibl... . Then you setup your transforms for overriding index name on third party Splunk instance. https://answers.splunk.com/answers/246672/how-can-i-override-an-index-name-based-on-sourcety.html

0 Karma

meidal_splunkin
New Member

thanks a lot for the help. I managed to get it working

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...