Getting Data In

HEC Sourcetype Transforms

jondukehds
Explorer

I am trying to split HEC data into multiple sourcetype  based on regex. The Docker platform we are using only provides three inputs for sending data to Splunk this way per group of servers.

Host

Port

Splunk Token

 

So I cannot define by token what the sourcetype is. I also have zero access to that interface to play around with it. In short, the data all has to come in on the same token. Capture2.PNG

Now to the question.

Referencing various answers on this site, along with the .spec splunk documentation for props.conf and transforms.conf.

This one.

https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-log-into-multiple-sourcetypes-on-a-he...

and

https://community.splunk.com/t5/Getting-Data-In/How-to-ingest-logs-from-a-single-file-and-split-them...

 

I am trying to, by REGEX pattern, split this one HEC sourcetype "mule_system"  into multiple sourcetypes on my heavy forwarder.

I have had some success, but with a weird side-effect. The transforms works, and in a real-time (30sec) search of the data appears in search as two sourcetypes.

Capture1.PNG

On a longer running search of this same event, (15m) it reverts back to the sourcetype defined in the inputs.conf for this hec token. "mule_system"

 

Here are the config files I am using on my heavy forwarder. Keep in mind that more transforms statements will be inserted as we categorize the events into sourcetypes.

Inputs.conf

 

[http://mule_hec]
disabled = 0
index = sandbox
sourcetype = mule_system
token = b7483125-9d88-49b9-bd90-xxxxxxxxxx
source = mule_hec

 

 

props.conf

 

[source::mule_hec]

#all matches everything for testing
#TRANSFORMS-changeSourcetype = mule-app-all
TRANSFORMS-changeSourcetype1 = mule-app-setsourcetype
TRANSFORMS-changeSourcetype2 = mule-http-request-setsourcetype

 

transforms.conf

 

#testing to see if transforms is working at all.
[mule-app-all]
DEST_KEY = MetaData::Sourcetype
REGEX = .*?
FORMAT = sourcetype::mule-rtf
WRITE_META = true

[mule-app-setsourcetype]
DEST_KEY = MetaData::Sourcetype
REGEX = (LoggerMessageProcessor)
FORMAT = sourcetype::mule-app
WRITE_META = true

[mule-http-request-setsourcetype]
DEST_KEY = MetaData::Sourcetype
#REGEX = msg=\"http request\"
REGEX = user-agent
FORMAT = sourcetype::mule-http-request
WRITE_META = true

 

 

 

0 Karma
1 Solution

jondukehds
Explorer
Spoiler
 

The issue here was in the transforms. One too many colons.

 

DEST_KEY = MetaData::Sourcetype

Should have been

DEST_KEY = MetaData:Sourcetype

 

View solution in original post

0 Karma

jondukehds
Explorer
Spoiler
 

The issue here was in the transforms. One too many colons.

 

DEST_KEY = MetaData::Sourcetype

Should have been

DEST_KEY = MetaData:Sourcetype

 

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