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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...