Splunk Search

How to setup regex to not index a specific URL?

iabreu
New Member

Hello Splunkers,

I'm having a little difficulty getting a regex on Splunk to not index a specifc URL. I tried many types of regexes, but none of them work. Below is the URL:

hxxps://xxcomputer.drmtz.com.br

Could you help me?

thanks.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You could do this in props.conf:

[your_sourcetype]
...
TRANSFORMS-null = filter_url

And in transforms.conf:

[filter_url]
REGEX = https://\d+computer.drmtz.com.br
DEST_KEY = queue
FORMAT = nullQueue

That'll send events containing that URL to /dev/null. I've assumed that the xx stands for a number. Note, this will catch and drop every event containing that string anywhere in its raw text.
Remember to restart your indexers after making this change.

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...