Splunk Search

How to reduce the cisco ASA logs using regex?

kiran331
Builder

Hi,

Is there a way to ignore a event containing the message before indexing using regex in props.conf and transforms.conf

ignore the msg contains "10.11.12.133 to 10.11.12.134 "?

0 Karma
1 Solution

somesoni2
Revered Legend

You can follow instructions from below link on dropping specific events ( containing those IP addresses) and index the rest.

http://docs.splunk.com/Documentation/Splunk/6.5.2/Forwarding/Routeandfilterdatad#Discard_specific_ev...

On INdexer/Heavy Forwarder (whichever comes first in flow)
In props.conf, set the TRANSFORMS-null attribute:
[

[YourSourceTypeNameHere]
TRANSFORMS-null= setnull

Create a corresponding stanza in transforms.conf. Set DEST_KEY to "queue" and FORMAT to "nullQueue":

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

Restart Splunk Enterprise.

View solution in original post

0 Karma

woodcock
Esteemed Legend

When you say "ignore" do you mean "prevent from being indexed" or "once indexed, prevent from showing in my search"?

Assuming the former:

http://docs.splunk.com/Documentation/Splunk/6.6.1/Forwarding/Routeandfilterdatad#Filter_event_data_a...

0 Karma

somesoni2
Revered Legend

You can follow instructions from below link on dropping specific events ( containing those IP addresses) and index the rest.

http://docs.splunk.com/Documentation/Splunk/6.5.2/Forwarding/Routeandfilterdatad#Discard_specific_ev...

On INdexer/Heavy Forwarder (whichever comes first in flow)
In props.conf, set the TRANSFORMS-null attribute:
[

[YourSourceTypeNameHere]
TRANSFORMS-null= setnull

Create a corresponding stanza in transforms.conf. Set DEST_KEY to "queue" and FORMAT to "nullQueue":

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

Restart Splunk Enterprise.

0 Karma

kiran331
Builder

Hi,

I also have 2 more IP's to avoid before Indexing, 169.225.1.2.3 and 165.244.253.255, Do I have to create new stanza Or I can use the old one to add Ip's?

0 Karma

horsefez
Motivator

just add them to the existing stanza like this

(10\.11\.12\.133|10\.11\.12\.134|<next-ip>|<next-ip>)
0 Karma

kiran331
Builder

Thank you

0 Karma

kiran331
Builder

Hi somesoni2,

I added this on Heavy Forwarder and also On indexers, I changed it to ignore any logs containing 169.244.255.255. I still see the logs indexing,

I added the below in props.conf and transforms.conf.

props.conf

[cisco:asa]
TRANSFORMS-null= setnull

[setnull]
REGEX = (169.254.255.255)
DEST_KEY = queue
FORMAT = nullQueue

0 Karma

horsefez
Motivator

Hi,
maybe try to "escape" the dots in your regex.

Like this: (169\.254\.255\.255)

0 Karma

kiran331
Builder

Hi,

I'm using . , It was changed in the comment.

0 Karma

somesoni2
Revered Legend

Did you restart Splunk after making the change? ALso, this filter will be applicable for any data that'll come after you made the change, any older data would remain as is.

0 Karma

kiran331
Builder

Thank you it worked.

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!

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...

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