Getting Data In

bucket retention and frozenTimePeriodInSecs

mataharry
Communicator

My index has a retention of 6 months with frozenTimePeriodInSecs=15552000.
But I still see some events that are older than the retention.

By example events that are from 6 month and 2 weeks.

Any thoughts ?

Tags (2)
1 Solution

yannK
Splunk Employee
Splunk Employee

A bucket that contains events overlapping the time retention will not be frozen until all the events are older than the retention.

By default indexes.conf has buckets with up to 3 months of span. So It's possible that you have buckets still overlapping
[main]
maxHotSpanSecs = 7776000
frozenTimePeriodInSecs = 188697600

A workaround may be to reduce the maxHotSpanSecs to a week, to force the buckets to be smaller, and rotate more often.

To verify the status of your buckets, and estimate if they meet the condition to be frozen you can use those dbinspect searches on the indexer.

  • for Splunk 6, for all indexes with autodetection from frozenTimePeriodInSecs

| dbinspect index=* | join index [|rest /services/data/indexes| eval index=title | table index frozenTimePeriodInSecs ]
| eval toNow=now()-endEpoch | convert num(toNow) | convert num(frozenTimePeriodInSecs)
| convert ctime(endEpoch) AS endEvent | convert ctime(startEpoch) AS startEvent
| eval shouldBeFrozen=if( ( state!="hot" AND state!="thawed" ) AND toNow>frozenTimePeriodInSecs,"yes","no")
| table index path id state startEvent endEvent shouldBeFrozen toNow frozenTimePeriodInSecs

  • for splunk 5 and 4, you have to manually add the values and do one index at a time

|dbinspect index=main
| eval frozenTimePeriodInSecs= 2592000
| convert timeformat="%m/%d/%Y:%H:%M:%S" mktime(earliestTime) AS endEpoch
| eval toNow=now()-endEpoch | convert num(toNow)
| convert num(frozenTimePeriodInSecs)
| eval shouldBeFrozen=if( ( state!="hot" AND state!="thawed" ) AND toNow>frozenTimePeriodInSecs,"yes","no")
| table path id state earliestTime latestTime endEvent shouldBeFrozen toNow frozenTimePeriodInSecs

View solution in original post

yannK
Splunk Employee
Splunk Employee

A bucket that contains events overlapping the time retention will not be frozen until all the events are older than the retention.

By default indexes.conf has buckets with up to 3 months of span. So It's possible that you have buckets still overlapping
[main]
maxHotSpanSecs = 7776000
frozenTimePeriodInSecs = 188697600

A workaround may be to reduce the maxHotSpanSecs to a week, to force the buckets to be smaller, and rotate more often.

To verify the status of your buckets, and estimate if they meet the condition to be frozen you can use those dbinspect searches on the indexer.

  • for Splunk 6, for all indexes with autodetection from frozenTimePeriodInSecs

| dbinspect index=* | join index [|rest /services/data/indexes| eval index=title | table index frozenTimePeriodInSecs ]
| eval toNow=now()-endEpoch | convert num(toNow) | convert num(frozenTimePeriodInSecs)
| convert ctime(endEpoch) AS endEvent | convert ctime(startEpoch) AS startEvent
| eval shouldBeFrozen=if( ( state!="hot" AND state!="thawed" ) AND toNow>frozenTimePeriodInSecs,"yes","no")
| table index path id state startEvent endEvent shouldBeFrozen toNow frozenTimePeriodInSecs

  • for splunk 5 and 4, you have to manually add the values and do one index at a time

|dbinspect index=main
| eval frozenTimePeriodInSecs= 2592000
| convert timeformat="%m/%d/%Y:%H:%M:%S" mktime(earliestTime) AS endEpoch
| eval toNow=now()-endEpoch | convert num(toNow)
| convert num(frozenTimePeriodInSecs)
| eval shouldBeFrozen=if( ( state!="hot" AND state!="thawed" ) AND toNow>frozenTimePeriodInSecs,"yes","no")
| table path id state earliestTime latestTime endEvent shouldBeFrozen toNow frozenTimePeriodInSecs

hajducko
Explorer

I think the Splunk 5/4 search is wrong. Wouldn't you want to make endEpoch as the latestTime as every event in the bucket needs to be older than the frozenTimePeriod. If I run that search, I get 'yes' for buckets that have an earliestTime that is older than the frozenTimePeriod, but with a latestTime that is newer. Those buckets wouldn't be deleted.

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...