Getting Data In

Monitoring an incrementing file name in a directory with a lot of different log files, how do I monitor just that file name?

joxley
Path Finder

A system that I am watching generates log files and rotates them such that the filenumbers increase, every X rows. Currently my monitor stanza is

[monitor:///var/log/mysystem/mainlog.00000.log]
index = my_index
sourcetype = mysystem_mainlog
disabled = false

There are lots of different log files in that directory. How should I monitor just mainlog*?

0 Karma
1 Solution

joxley
Path Finder

The solution is to monitor the directory with a whitelist:

 [monitor:///var/log/mysystem]
 whitelist = mainlog.\d+.log
 index = my_index
 sourcetype = mysystem_mainlog
 disabled = false

View solution in original post

joxley
Path Finder

The solution is to monitor the directory with a whitelist:

 [monitor:///var/log/mysystem]
 whitelist = mainlog.\d+.log
 index = my_index
 sourcetype = mysystem_mainlog
 disabled = false
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...