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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...