Getting Data In

Prevent log events with specific text string from indexing

cwwirth
Explorer

I've got a seemingly simple problem that I'm having a bit of difficulty on. I've been tasked with excluding log events containing a specific text string (in this case, an IP address) from being indexed in Splunk. I've done similar with sources such as Windows event logs (using props.conf and transforms.conf to send to nullQueue based on a regex), but the catch this time is that the event could come from any host, and be any sourcetype. Basically, "if any event comes into Splunk with this text string, send it to nullQueue." Any ideas?

0 Karma
1 Solution

Ayn
Legend

Just do as you've done previously, and make use of that you can use the [default] stanza in props.conf to have transforms apply to all events.

View solution in original post

bmacias84
Champion

Hello, You should be able to use the same method using your props.conf and transforms.conf. Except this time you will define a your transfrom under default stanza in your props.conf. The transform should be applied to all stanza in your props.conf.


#props.conf
[default]
TRANSFORMS-remove_events = ipremove

Hope this helps or gets you started. Dont forget to vote up and accept answers.

Cheers

kristian_kolb
Ultra Champion

According to the docs for props.conf, you can set global settings under the stanza called default instead of a source/sourcetype/host.

http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf

props.conf

[default]
TRANSFORMS-who_did_it = dunno

transforms.conf

[dunno]
REGEX = <insert your ip>
DEST_KEY = queue
FORMAT = nullQueue

I have never done this (and to be honest, it sounds a bit like someone wanting to cover his/her tracks :), but I can't see why it shouldn't work.

/Kristian

Ayn
Legend

Just do as you've done previously, and make use of that you can use the [default] stanza in props.conf to have transforms apply to all events.

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!

How to find the worst searches in your Splunk environment and how to fix them

Everyone knows Splunk is a powerful platform for running searches and doing data analytics. Your ...

Share Your Feedback: On Admin Config Service (ACS)!

Help Us Build a Better Admin Config Service Experience (ACS)   We Want Your Feedback on Admin Config Service ...

Build the Future of Agentic AI: Join the Splunk Agentic Ops Hackathon

AI is changing how teams investigate incidents, detect threats, automate workflows, and build intelligent ...