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
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...