Getting Data In

Will our current configuration work for monitoring our application logs and changing the sourcetype?

rrmavani
Engager

Hello Splunk Guru,

In our environment, we have many Universal forwarders, few indexers and couple of search heads.

Files to monitor from many forwarders

/application/app1/logs/*
/application/app2/logs/*
/application/app3/logs/*

Will the configuration below work? If not work, what should we do?
In Forwarder
inputs.conf

[monitor:///application/*/logs/*]
followTail = 0 

props.conf

[source::/application/*/logs/*]
TRANSFORMS-change_stuff = change_sourcetype

In Indexer
transforms.conf

[change_sourcetype]
SOURCE_KEY = MetaData:Source
REGEX = /application/*/logs/*
DEST_KEY = MetaData:Sourcetype
FORMAT = sourcetype::$1
0 Karma
1 Solution

woodcock
Esteemed Legend

If I understand your goal (unsure), the only changes that you need to make are to remove followTail = 0 and replace it with a preliminary sourcetype setting (which you will override later) like this:

sourcetype = ChangeToAppName

Then change your transforms.conf line to this:

REGEX = /application/([^/]+)/logs

This will change your sourcetypetype to the 2nd segment of your path, which I think is what you are trying to do (it really doesn't make sense to set your sourcetype to the same thing as your source).

View solution in original post

woodcock
Esteemed Legend

If I understand your goal (unsure), the only changes that you need to make are to remove followTail = 0 and replace it with a preliminary sourcetype setting (which you will override later) like this:

sourcetype = ChangeToAppName

Then change your transforms.conf line to this:

REGEX = /application/([^/]+)/logs

This will change your sourcetypetype to the 2nd segment of your path, which I think is what you are trying to do (it really doesn't make sense to set your sourcetype to the same thing as your source).

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...