Splunk Enterprise

Why is Splunk not ingesting .txt logfiles starting with a numeric value?

dbrooks_CIR
New Member

I am trying to bring in some .txt logfiles using Splunk forwarder. There are several logs in the directory, such as Log.txt, 10Log.txt, 20Log.txt, etc. These files are changed daily, and the 10, 20, etclog.txt files are written to daily. So far, I can only get Splunk to ingest the Log.txt file and nothing else. My inputs.conf file is currently as below. I have tried to monitor just *.txt with the same results. Only Log.txt is read/ingested.

[monitor://E:\Logs\CIR_Remote\*Log.txt]
disabled = false
sourcetype = LOG4NET
index = log4net
initCrcLength=1024

any input would be appreciated!

Labels (1)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

I don't know why (didn't bother to investigate it) but I noticed that sometimes specifying wildcard path to files doesn't work whereas specifying whole directory with a whitelist matching only set of files does.

Unfortunately, you can't specify two different sets of files from the same directory since each input stanza must be unique.

Anyway, check your config with

splunk btool inputs list --debug

and verify list of monitored files with

splunk list monitor
0 Karma

somesoni2
Revered Legend

Check if first few lines/characters of all those files (Log.txt and <N>Log.txt) have some common header/characters. If they've some common header/characters, Splunk will think that they're rolled log files. To resolve it, you'll need to adjust initCrcLength value to be slighly more that the length of those common header/characters.

0 Karma

dbrooks_CIR
New Member

No, the files are not the same. They start with a datetime stamp, and then include error information. They have never been ingested at all, always skipped for some reason.

0 Karma
Get Updates on the Splunk Community!

Learn Splunk Insider Insights, Do More With Gen AI, & Find 20+ New Use Cases You Can ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Buttercup Games: Further Dashboarding Techniques (Part 7)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Stay Connected: Your Guide to April Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...