Getting Data In

Log File Rotation

snapfinger
Engager

When splunk is watching a directory for log files will it reindex a file that gets rotated? I am trying to make sure that some of my logs are not getting indexed twice.

Example:

file1.log gets changed to file1.log12212010 service creates new file1.log and continues logging.

Tags (1)
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

It will not reindex your file. Splunk will not do this by default. Normally, it identifies a file using a hash of the first 256 bytes of the file content, and not the file path/name. (This can be overridden.) However, do note that if you rename and compress the file, it will be reindexed, but you can suppress this by blacklisting compressed files by the name.

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee

It will not reindex your file. Splunk will not do this by default. Normally, it identifies a file using a hash of the first 256 bytes of the file content, and not the file path/name. (This can be overridden.) However, do note that if you rename and compress the file, it will be reindexed, but you can suppress this by blacklisting compressed files by the name.

Get Updates on the Splunk Community!

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

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...