Following are the configurations that you can set to keep data only for exactly 30 days. The data in Splunk is written in hot buckets. The name of the bucket includes the min and max of the _time of the data included in it. When Splunk has to apply data retention, based on age, then it picks the buckets whose max _time value is older than retention period. So if a buckets contains data for 3 day period, it won't get deleted until day 33 and you'd see some partial data for day 31/32/33 (that's what is happening in your case).
The below setting will enforce Splunk to contain maximum of 1 day worth of data in the buckets, so that buckets can retire on exact day basis. NOTE: If you set this too small, you can get an explosion of hot/warm buckets in the filesystem. Default to 90 days.
Indexes.conf on your Indexers
[yourindex] ...other settings... maxHotSpanSecs = 86400 # 1 day frozenTimePeriodInSecs = 2592000 # 30 days
See more info of retention policies here:
So if I create an indexes.conf in '.\Splunk\etc\system\local' and change it to this (and restart splunk service), it'll work?
[wineventlog] coldPath = $SPLUNK_DB\wineventlog\colddb homePath = $SPLUNK_DB\wineventlog\db thawedPath = $SPLUNK_DB\wineventlog\thaweddb maxHotSpanSecs = 2592000 frozenTimePeriodInSecs = 2592000
It should.. You've stand alone Indexer? Do you have one indexer OR many? The changes from location 'Splunk\etc\system\local' works but the preferred location is etc/apps under some custom app (for better portability).