Deployment Architecture

インデックスのデータを時間経過で自動削除したい

takuyaikeda
Engager

現在インデックス内のデータ量が増え続ける為、自動で1年経過したデータを削除させたいです。
どのように設定すれば、1年経過したデータを自動で削除させることが出来ますか?

-English-
Since the amount of data in the index continues to increase, I want to automatically delete data that has passed one year.
How can I automatically delete data that has passed one year?

melonman
Motivator

Indexのリテンション設定基準は幾つかあり、時間か容量(もしくはその裏に潜んでいるバケツの数云々)がありますので、一度以下参照いただいてご確認いただくことが安全かと思います。

設定内容としては、index.confのfrozenTimePeriodInSecsの設定をデフォルトの6年から1年に変更することになるかと思います。

frozenTimePeriodInSecs = 
* The number of seconds after which indexed data rolls to frozen.
* If you do not specify a 'coldToFrozenScript', data is deleted when rolled to
  frozen.
* NOTE: Every event in a bucket must be older than 'frozenTimePeriodInSecs'
  seconds before the bucket rolls to frozen.
* The highest legal value is 4294967295.
* Default: 188697600 (6 years)

https://docs.splunk.com/Documentation/Splunk/latest/Admin/Indexesconf

ただ、以下の注意書きもドキュメント中にありますので、一度ドキュメントに目を通していただいて、設定を確認しただいたほうがいいと思います。(不要にデータ消しちゃうとまずいので)

If maxTotalDataSizeMB is reached before frozenTimePeriodInSecs, data will be rolled to frozen before the configured time period has elapsed. If archiving policy has not been properly configured, unintended data loss can occur.

以下ご参考情報ということで掲載させていただきます。

ドキュメントは以下を参照していただければと思います。
https://docs.splunk.com/Documentation/Splunk/latest/Indexer/Setaretirementandarchivingpolicy
以下の日本語マニュアル(pdf)だと、「インデクサーおよびインデクサーのクラスタの管理 」の p42あたり。
https://docs.splunk.com/Documentation/Splunk/latest/Translated/Japanesemanuals
index.confの内容
https://docs.splunk.com/Documentation/Splunk/latest/Admin/Indexesconf

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...