Getting Data In

Want to forward selective portion of the log file by forwarder to indexer

somnathnag
Engager

Hello :
What I have to set in inputs.conf or outputs.conf of the forwarder so that I can send selective portion of the application log file to indexer. At present our setup forwards the whole log file - which we don't need and this is hurting the network performance also.
Thanks
Somnath

Tags (2)
0 Karma
1 Solution

lguinn2
Legend

Take a look at the following in the manual

Perform selective indexing and forwarding

You can filter the data in two different places:

  • Option 1: Filter on the indexer(s). This is the recommendation when you are filtering less than 50% of the data. Why? Because by filtering on the indexer(s), you can use the Universal Forwarder on the production systems.
  • Option 2: Filter on the forwarders. This requires that you use the heavy forwarder instead of the Universal Forwarder, and it will take some processing cycles on the production systems. Still, this may be the best choice if you are seeing network performance issues, or if you are filtering out more than 50% of the data.

The syntax and configuration files are exactly the same in either case - it is simply a matter of where you put them.

View solution in original post

lguinn2
Legend

Example: Assume that the data you want to filter is in a file named big.log. (Note that in real life, you would have to provide the full path.)

You want to eliminate any lines that have the word INFO or WARN.

In the configuration file $SPLUNK_HOME\etc\system\local\props.conf

[source::big.log]
TRANSFORMS-t1 = filterEvents

In the configuration file $SPLUNK_HOME\etc\system\local\transforms.conf

[filterEvents]
REGEX = (?:INFO|WARN)
DEST_KEY = queue
FORMAT = nullQueue
0 Karma

lguinn2
Legend

Take a look at the following in the manual

Perform selective indexing and forwarding

You can filter the data in two different places:

  • Option 1: Filter on the indexer(s). This is the recommendation when you are filtering less than 50% of the data. Why? Because by filtering on the indexer(s), you can use the Universal Forwarder on the production systems.
  • Option 2: Filter on the forwarders. This requires that you use the heavy forwarder instead of the Universal Forwarder, and it will take some processing cycles on the production systems. Still, this may be the best choice if you are seeing network performance issues, or if you are filtering out more than 50% of the data.

The syntax and configuration files are exactly the same in either case - it is simply a matter of where you put them.

somnathnag
Engager

Thanks a lot.
Probably we would go with the heavy forwarder. I looked into your attached document - couldn't figure out the configuration for selective event forwarding. Can you please provide a sample configuration file ?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...