Getting Data In

How to write a monitor stanza for configuring inputs.conf on forwarder for sub directories?

iamlearner123
Explorer

Hello,

I have a directory with sub directories and then logs. Can i please know how to write monitor stanza for this type of log monitoring ?

For instance,

/app/web/apacheweb -> main directoy

/app/web/apacheweb/apacheweb01/apache1.log -> sub directory with log
/app/web/apacheweb/apacheweb02/apache.2log -> sub directory with log
/app/web/apacheweb/apacheweb03/apache3.log -> sub directory with log

But all the sub directories have a same log format . so, i believe i can assign same sourcetype.

0 Karma

somesoni2
Revered Legend

You can use this

[monitor:///app/web/apacheweb/apacheweb*/apache*.log]
index = yourIndexHere
sourcetype=yourSourceTypeHere
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...