Getting Data In

Is there a way to turn off internal splunk log rotation or archive off the internal logs

marvatwork
Explorer

I need to keep the data in $SPLUNK_HOME/var/log/splunk.
I've tried to increase the max file size and increase the number of logs; however, this has shown to be inadequate.
Is there a way that I can just turn off the rotation? If not, can I archive the old logs instead of having them rotate off?

rsennett_splunk
Splunk Employee
Splunk Employee

The retention _internal index (and other internal logs) is set just like any other index.
In the case of the default internal logs, you'll find the settings in $SPLUNK_HOME/etc/system/default/indexes.conf
You'll find this stanza, for instance:

[_internal]
homePath   = $SPLUNK_DB/_internaldb/db
coldPath   = $SPLUNK_DB/_internaldb/colddb
thawedPath = $SPLUNK_DB/_internaldb/thaweddb
tstatsHomePath = volume:_splunk_summaries/_internaldb/datamodel_summary
maxDataSize = 1000
maxHotSpanSecs = 432000
frozenTimePeriodInSecs = 2592000

It's that last one that decides how long it hangs around before it is deleted (259200 seconds = 30 days)

Create $SPLUNK_HOME/etc/system/local/indexes.conf

[_internal]
frozenTimePeriodInSecs= NumberOfSecondsYouWantToRetainInternalLogs

Create a stanza for each index you want to keep longer...

With Splunk... the answer is always "YES!". It just might require more regex than you're prepared for!
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...