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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...