Splunk Search

regex wimp

chowell
Explorer

I have this in a transforms.conf file on one of my forwarders. My goal is to drop everything from either of the IP's, but they keep coming through. What am I doing wrong?

[setnull]
REGEX = .*(10\.3\.0\.(11|12)).*
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = .
DEST_KEY = queue
FORMAT = indexQueue

THanks,

--Carl

Tags (1)

landen99
Motivator

My bet is that your ip exists in the host field and not in the _raw text.

[setnull]
REGEX = 10\.3\.0\.1[12]
SOURCE_KEY=MetaData:Host
DEST_KEY = queue
FORMAT = nullQueue
0 Karma

ftk
Motivator

You don't have to include your wildcards in the front and back. Give it a try as follows:

[setnull]
REGEX = 10\.3\.0\.(11|12)
DEST_KEY = queue
FORMAT = nullQueue

Also make sure that you are actually applying this routing rule to your applicable sourcetype in props.conf....e.g.

[mysourcetype]
TRANSFORMS-setnull = setnull
Get Updates on the Splunk Community!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...