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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...