Getting Data In

How can I split custom Windows Event Logs from the same source into multiple source types?

remygoglio
New Member

I have a custom Windows Event Log source that I want to monitor via an universal forwarder.

I'd like to split the events into 2 buckets resulting in 2 different source types in Splunk:
-first bucket is a made of a list of known codes
-second bucket is made of the rest of the events

in inputs.conf of the universal forwarder, I added the following Stanza

[WinEventLog://MyCustomSource]
disabled = 0
start_from = oldest
sourcetype=WinEventLogGeneric
blacklist=10001

[WinEventLog://MyCustomSource]
disabled = 0
start_from = oldest
sourcetype=WinEventLogWellKnownEvents
whitelist=10001

This does not seem to work.

My goal is to end up with 2 different source types, one for the generic events and one for well known events.

How can I do that?

0 Karma

kmccririe_splun
Splunk Employee
Splunk Employee

The Cisco ASA TA does something similar to what your trying. If you look at the props.conf and transforms.conf that comes with that add-on it will help.

What that app does is takes that one source and assigns it sourcetypes based on regex. So you can split up one source into different sections with regex and give those sections sourcetypes.

Something like this:
inputs.conf:
[WinEventLog://MyCustomSource]
disabled = 0
start_from = oldest
sourcetype=WinEventLog

props.conf:
[WinEventLog]
TRANSFORMS-force_sourcetype_for_windows = wellKnowEvents, GenericEvents

transforms.conf:
[wellKnownEvents]
DEST_KEY - MetaData:Sourcetype
REGEX = < your regex that matches these events >
FORMAT = sourcetype:: < name of sourcetype>

[GenericEvents]
DEST_KEY - MetaData:Sourcetype
REGEX = < your regex that matches these events >
FORMAT = sourcetype:: < name of sourcetype>

0 Karma

remygoglio
New Member

Does the universal forwarder read props.conf?
It does not seem to based on my tests, which would explain why nothing is working.

0 Karma

remygoglio
New Member

That does not seem to work.
I looked at other similar questions/answers, and it seems like others have the exact same issue.

What I get is sourcetype=WinEventLog as opposed to the source types set in transforms.conf.

I have even tried my regex in the search: index="myindex" | regex _raw="EventCode=(10001)"

Any other idea?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...