Getting Data In

How to filter out specific events sent via Universal Forwarder?

rkymtnhigh
Explorer

I have one indexer that is receiving events from a remote Windows host via the Universal Forwarder.

I am trying to filter out events that contain the string 'empty logger' in the log file D:\Logs\Test\testlog5_29_20.log file on the remote server.

I have attempted to use the props.conf and the transforms.conf files on the indexer to send the events matching the regex to nullqueue, but the events in question are still making it.

I am suspecting that the source stanza in the props.conf file isn't correct, as I am specifying a directory that only exists on the remote Windows hosts.

Am I correct in that assumption?

Labels (3)

rkymtnhigh
Explorer

Resolved the issue using [source::....log] stanza in props.conf.
Thanks everyone for your help.

0 Karma

rkymtnhigh
Explorer

I think my issues lies with my props.conf source..
I am currently using:

[source::d:\logs\...\*.log]
TRANSFORMS-null = setnull

I tried using the sourcetype that shows up when I search these events "SampleSourcetype2"

Here is how I have it set:

[sourcetype::SampleSourcetype2]
TRANSFORMS-null = setnull

Then in transforms.conf

[setnull]
REGEX = empty logger
DEST_KEY = queue
FORMAT = nullQueue

The events with "empty logger" are still being indexed however.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

That syntax looks OK (well not so much. See my later comment). What does the [setnull] stanza in your transforms.conf file look like?

---
If this reply helps you, Karma would be appreciated.
0 Karma

rkymtnhigh
Explorer
 [setnull]
 REGEX = empty logger
 DEST_KEY = queue
 FORMAT = nullQueue
0 Karma

richgalloway
SplunkTrust
SplunkTrust

BTW, [sourcetype::SampleSourcetype2] is not supported in props.conf. Use [SampleSourcetype2].
Also, the backslashes must be escaped. source::d:\\logs\\...\\*.log

---
If this reply helps you, Karma would be appreciated.
0 Karma

mchristopherson
Explorer

We are doing this in the following fashion - but we would need to see how you have your configs formatted:

props.conf

[sourcetype:to:modify]
TRANSFORMS-null = StanzaNameInTransforms

This is simply the name we are giving it. It must start with TRANSFORMS but you can use -"name" to have multiple TRANSFORMS on one sourcetype.

transforms.conf

[StanzaNameInTransforms]
REGEX = 
DEST_KEY= queue
FORMAT = nullQueue

Your REGEX can be a partial portion of a line. I would play around with that bit but in one of our examples, we simply have a string that shows up in our examples we want dropped. From your example it should be:

[StanzaNameInTransforms]
REGEX = empty logger
DEST_KEY= queue
FORMAT = nullQueue
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Please share a sample event (sanitized) and your current props and transforms for the sourcetype.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

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