Getting Data In

Why is wildcard not working in log file name for input.conf?

phamxuantung
Communicator

Hello, I have the input.conf for several log files as

 

[monitor:///u01/mnt/log-1/data/trafficmanager/access/*]
index = myindex
sourcetype = csvtype
initCrcLength = 1048576

 

The log file name is structured as access_worker_*_YYYY_mm_dd.log. For example: access_worker_5_03_21.log, access_worker_6_03_21.log, access_worker_5_03_20.log, etc.

The stanza that I put in don't work so I try for a specific file name, such as

 

[monitor:///u01/mnt/log-1/data/trafficmanager/access/access_worker_5_03_21.log]
index = myindex
sourcetype = csvtype
initCrcLength = 1048576

 

 Then the log was pull in no problem. The problem that I see is the way I use my wildcard, somehow don't catch all the log file that I want to monitor.

Can anyone point out how to fix this problem?

Labels (2)
Tags (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @phamxuantung ,

there's no reason for this behavior,

please try with this header:

[monitor:///u01/mnt/log-1/data/trafficmanager/access/access_worker_*.log]

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @phamxuantung ,

are you sure that the problem is the filename?

check if the not read file has the same content (event if a different file name) of an already ingested file, because Splunk doesn't index twice a file.

If the files to read always have diferent filename, you could try to add the following option:

crcSalt = <SOURCE>

Ciao.

Giuseppe

0 Karma

phamxuantung
Communicator

The files always have different name and the content are also different. The different between my 2 config (where one work and one don't) is the path and file name

[monitor:///u01/mnt/log-1/data/trafficmanager/access/*]

-> This one don't work

vs

[monitor:///u01/mnt/log-1/data/trafficmanager/access/access_worker_5_03_21.log]

-> This does but can only index that specific file "access_worker_5_03_21.log" but not the other with similar name.

So the problem I think lie in how I use my wildcard.

I added crcSalt =<SOURCE> but it don't work.

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @phamxuantung ,

there's no reason for this behavior,

please try with this header:

[monitor:///u01/mnt/log-1/data/trafficmanager/access/access_worker_*.log]

Ciao.

Giuseppe

phamxuantung
Communicator

Your stanza work and the log files are indexed as normal. I just wonder why Splunk can't catch all file with the wildcard, so weird.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @phamxuantung ,

as I said it's a strange behavior that I never experienced before, anyway I'm happy that you solved your issue.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Cultivate Your Career Growth with Fresh Splunk Training

Growth doesn’t just happen—it’s nurtured. Like tending a garden, developing your Splunk skills takes the right ...