Getting Data In

How do you monitor certain files in the directory using whitelist?

mlevsh
Builder

Hi,

We have numerous files in the directory we want to monitor: different types logs files and their snapshots.

For example:

audit.log
audit.log.2018-05-21.log
audit.log.2018-05-20.log
server.log
server.log.1
server.log.2

We need to continuously monitor only audit.log and server.log logs.

This data input doesn't seem to work. Dated audit.log* were ingested as well.

[monitor://E:\dir\subdir1\subdir2\subdir3\log]
disabled = false
index = indexname
sourcetype = sourcename
followTail = 0 
whitelist = audit.log$|server.log$

Any advice on how would you do it?

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi mlevsh,
you could try something like this:

 [monitor://E:\dir\subdir1\subdir2\subdir3\log\audit.log]
 disabled = false
 index = indexname
 sourcetype = sourcename
 followTail = 0 

 [monitor://E:\dir\subdir1\subdir2\subdir3\log\audit.log\server.log]
 disabled = false
 index = indexname
 sourcetype = sourcename
 followTail = 0 

Bye.
Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi mlevsh,
you could try something like this:

 [monitor://E:\dir\subdir1\subdir2\subdir3\log\audit.log]
 disabled = false
 index = indexname
 sourcetype = sourcename
 followTail = 0 

 [monitor://E:\dir\subdir1\subdir2\subdir3\log\audit.log\server.log]
 disabled = false
 index = indexname
 sourcetype = sourcename
 followTail = 0 

Bye.
Giuseppe

mlevsh
Builder

@cusello , that was one of the options. I was looking for more elegant solution , maybe 🙂

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...