Getting Data In

Filter subset of a sourcetype at forwarder?

muebel
SplunkTrust
SplunkTrust

I have a DC that forwards a huge amount of wineventlog:Security events to my indexer. I want to configure the forwarder so that it won't forward events that have an EventCode value I specify. I.E. EventCode 5156

What would be the best way of going about this? Has anybody already done something similar, and if so, what would you suggest to be a less important EventCode?

0 Karma
1 Solution

southeringtonp
Motivator

Splunk is actually running on the DC? Are you using a Lightweight or heavyweight forwarder?

You can use nullQueue to drop the events, but IIRC you will need to run as a heavyweight forwarder. Otherwise, you would need to filter at the indexer.


Take a look at this thread:
http://answers.splunk.com/questions/6179/wmi-filter-remote-eventlogs-by-host-groups


Since you said you were using an LWF, make these changes on your indexer. Configure a transform to match the traffic you want to discard.

# transforms.conf
[drop-noise]
REGEX=(?ms)host=noisyhostname.*?EventCode=5156
DEST_KEY = queue
FORMAT = nullQueue

Then enable the transform in props.conf:

# props.conf
[source://xxx]
TRANSFORMS-dropnoise = drop-noise

Note - I don't use LWF, so the regex may not be quite right. I would favor using "host=" over "ComputerName=" if it works, on the premise that it would be Splunk-assigned rather than part of the message body, but I'm not 100% sure host is valid here.

View solution in original post

0 Karma

southeringtonp
Motivator

Splunk is actually running on the DC? Are you using a Lightweight or heavyweight forwarder?

You can use nullQueue to drop the events, but IIRC you will need to run as a heavyweight forwarder. Otherwise, you would need to filter at the indexer.


Take a look at this thread:
http://answers.splunk.com/questions/6179/wmi-filter-remote-eventlogs-by-host-groups


Since you said you were using an LWF, make these changes on your indexer. Configure a transform to match the traffic you want to discard.

# transforms.conf
[drop-noise]
REGEX=(?ms)host=noisyhostname.*?EventCode=5156
DEST_KEY = queue
FORMAT = nullQueue

Then enable the transform in props.conf:

# props.conf
[source://xxx]
TRANSFORMS-dropnoise = drop-noise

Note - I don't use LWF, so the regex may not be quite right. I would favor using "host=" over "ComputerName=" if it works, on the premise that it would be Splunk-assigned rather than part of the message body, but I'm not 100% sure host is valid here.

0 Karma

southeringtonp
Motivator

See edits above and reference to previous question.

0 Karma

muebel
SplunkTrust
SplunkTrust

now that I think on it I believe it is a lightweight forwarder. So I can't filter out specific events before they get sent across? How could I configure the indexer to filter a specific eventtype from a specific host?

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...