Splunk Search

How to use SEDCMD to skip whole lines matching a regex pattern from being indexed?

dominiquevocat
SplunkTrust
SplunkTrust

We have a system where at times the engineers running it need to enable debug output. This naturally kills the splunk license easily :-).

I currently use something like this on the indexer but it uses lots of resources at times so i would like to do it with a sedcmd on the sending machine.

transforms.conf
[setnull]
REGEX = .+-DBG_.+
DEST_KEY = queue
FORMAT = nullQueue

So the pattern is rather easy 🙂 but how can i use SEDCMD to skip lines matching the pattern from being sent to the indexer?

0 Karma

woodcock
Esteemed Legend

You need to reinstall your forwarder as a heavy forwarder and then do one of the to "delete some and forward the rest" options in the link below. Do note what it says about using SEDCMD (it does not support the delete capabilitybut you can use thereplace` capability to swap with "nothing"):

http://answers.splunk.com/answers/122830/filtering-fields-in-log-before-forward-to-indexing.html

This page may also help:

http://docs.splunk.com/Documentation/Splunk/6.2.3/Data/Anonymizedatausingconfigurationfiles

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...