Splunk Search

Filter out "everything but..." from certain source with heavy forwarder?

km_sec
New Member

I want to filter out everything in my massive firewall logs except those events with event codes for a few important event types. Here's what I have right now:

inputs.conf

[monitor:///data/HOSTS/edge_firewall/edge/.../*.log]
sourcetype = cisco:asa
host_segment = 5
index = edge_firewall

props.conf

[source::/data/HOSTS/edge_firewall/edge/.../*.log]
TRANSFORMS-set = Edge_Null,Edge_Filter

transforms.conf

[Edge_Null]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[Edge_Filter]
REGEX = \[.*(305010|305011|305012|302014|302016).*\]
DEST_KEY = queue
FORMAT = indexQueue

I previously used [source::///data/HOSTS/edge_firewall/edge/.../*.log] as a <SPEC> in props.conf because it matched what is used in inputs.conf. When I did this, everything in the source was being indexed, not just the parts in the regex, so I know the inputs.conf stanza works. After changing it to what you see above, however, nothing from that source is sent, which leads me to believe it is all being sent to nullQueue and either my regex in [Edge_Filter] is invalid or nothing is getting past [Edge_Null].

Why isn't this working? What have I done wrong and how can I fix it? Would it be wiser to use an inverse regex (i.e. ^(?!.*(305010|305011|305012|302014|302016))) in [Edge_Null] instead?

0 Karma

abhijitmishra87
Explorer

You have a '.' (dot) matched to Edge_Null. That would match everything and send everything to nullQueue.

0 Karma

km_sec
New Member

So should I remove [Edge_Filter] and put something like ^(?!.*(305010|305011|305012|302014|302016)) in [Edge_Null] to grab what I want out of nullQueue? Will that regex work, and how would I send the result to indexQueue?

0 Karma
Get Updates on the Splunk Community!

.conf25 Registration is OPEN!

Ready. Set. Splunk! Your favorite Splunk user event is back and better than ever. Get ready for more technical ...

Detecting Cross-Channel Fraud with Splunk

This article is the final installment in our three-part series exploring fraud detection techniques using ...

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...