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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...