Alerting

How can I get an email alert once my index is close to its retention period?

csahoo
Explorer

Hi All,


I am using Splunk Cloud where I have an index whose retention period is set as 10 years, so I just want to understand how can I get an email alert once my index is close to its retention period .

Labels (3)
0 Karma

somesoni2
Revered Legend

You can run something like this to get alert when minimum time (timestamp of oldest event in the index) is older than 90% of the retention period:-

| rest /services/data/indexes | table title minTime frozenTimePeriodInSecs | convert mktime(minTime) timeformat="%FT%T%z"  | where now()-minTime>frozenTimePeriodInSecs*0.9 | convert ctime(minTime) | eval retention=tostring(frozenTimePeriodInSecs,"duration")

 Problem with this is that it may give false positive. The retention is done based on size as well as age. Also, retention is done by the bucket and bucket is retired only when the newest event in the index is older than retention period. You can get an indication with this search but it may not be 100% full proof.

PickleRick
SplunkTrust
SplunkTrust

With dbinspect you can get details of single buckets. So dbinspect should give enough details to warn against both rolling oldest bucket as well as hitting size limit.

0 Karma
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 ...