Getting Data In

Index searchable retentions questions

cbiraris
Path Finder

Hi team,

i have a index with 4 sourcetype.  index has searchable retention of 4 months.

is there any way we can keep same retention for 3 sourcetype and 1sourcetype can be increased to 8 months ?

For example:

Index=xyzsourcetype = 1searchable retention 4 Months
 sourcetype = 2searchable retention 4 Months
 sourcetype = 3searchable retention 4 Months
 sourcetype = 4searchable retention 8 Months
Labels (1)
Tags (1)
0 Karma

kiran_panchavat
Champion

@cbiraris 

In Splunk, retention policies are set at the index level, not at the sourcetype level. This means that all sourcetypes within a single index (like your xyz index) will inherit the same retention period 4 months in your case. Unfortunately, there’s no native way to assign different retention periods to individual sourcetypes within the same index.
Did this help? If yes, please consider giving kudos, marking it as the solution, or commenting for clarification — your feedback keeps the community going!
0 Karma

PickleRick
SplunkTrust
SplunkTrust

As others already pointed out - no. So you've just hit one of the main reasons for splitting data into indexes. There are two main factors when deciding whether you want the data in single index or multiple ones:

1) Data retention settings (and that's your case)

2) Access control

Both of those work at index level.

There are some other things which might come into play in some border cases (like not mixing high-volume and low-volume data in a single index) but you get much less often that deeply into  data architecture.

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @cbiraris 

Check out https://lantern.splunk.com/Splunk_Platform/Product_Tips/Data_Management/Setting_data_retention_rules.... for some guidance on best practices for retention.

When you consider which index should collect a data source, remember that you set retention policies by index. If you have two data sources, one that you need to keep for 3 years and one that you can discard after 30 days, send them to separate indexes. Otherwise, you will be paying to store 35 months of data you don’t really want, or discarding data 35 months too early.

Essentially you should split your data into different indexes when you have different retention, permissions or usecase/category. Its a good idea to use a naming convention to achieve this so you can easily distinguish between different types. Such as adding a _nonprod or _prod suffix for non-production/production data - which might have different RBAC / Users.

Please let me know how you get on and consider adding karma to this or any other answer if it has helped.
Regards

Will

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @cbiraris ,

in Splunk retention is only defined at index level, so the only way is to store the longer sourcetype in a different index.

Ciao.

Giuseppe

0 Karma

vsommer
Explorer

Hi @cbiraris,

unfortunately retention time can only be applied to indexes.

 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...