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
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!

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 ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...