Splunk Enterprise Security

Splunk inputs.conf - Read from all files in a directory except one file

vishwanath119
New Member

Need to read from all files present in /temp/logs/ directory except one file abc.log

Directory looks like
xyz.log
ab.txt
ef.log
abc.log

inputs.conf
[monitor:///temp/logs/]
index = abc_xyz
sourcetype = server
disabled = false

0 Karma
1 Solution

PavelP
Motivator

Need to read from all files present in /temp/logs/ directory except one file abc.log

if your problem is that all files are being reading, but you want to exlclude abc.log then you need to add blacklist:

[monitor:///temp/logs/*]
index = abc_xyz
sourcetype = server
disabled = false
blacklist = */abc\.log

View solution in original post

0 Karma

PavelP
Motivator

Need to read from all files present in /temp/logs/ directory except one file abc.log

if your problem is that all files are being reading, but you want to exlclude abc.log then you need to add blacklist:

[monitor:///temp/logs/*]
index = abc_xyz
sourcetype = server
disabled = false
blacklist = */abc\.log
0 Karma

vishwanath119
New Member

Why */ is used?

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi òvishwanath119,
probably it's a visualization problem, try this inputs.conf

[monitor:///temp/logs/*]
index = abc_xyz
sourcetype = server
disabled = false

If you continue to have the problem, check if the unread file is a copy of another one, because by default Splunk doesn't read twice the same file even if with two different names.
If you want to read twice the same file with different names, you have to use the option crcSalt = <SOURCE> .

Ciao.
Giuseppe

0 Karma
Get Updates on the Splunk Community!

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...

Join Us at the Builder Bar at .conf24 – Empowering Innovation and Collaboration

What is the Builder Bar? The Builder Bar is more than just a place; it's a hub of creativity, collaboration, ...

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...