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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...