ilm.asciidoc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // tag::fleet[]
  2. {fleet} and {agent} use the following built-in lifecycle policies:
  3. * `logs`
  4. * `metrics`
  5. * `synthetics`
  6. You can customize these policies based on your performance, resilience, and
  7. retention requirements.
  8. To edit a policy in {kib}, open the main menu and go to **Stack Management >
  9. Index Lifecycle Policies**. Click the policy you'd like to edit.
  10. You can also use the <<ilm-put-lifecycle,update lifecycle policy API>>.
  11. [source,console]
  12. ----
  13. PUT _ilm/policy/logs
  14. {
  15. "policy": {
  16. "phases": {
  17. "hot": {
  18. "actions": {
  19. "rollover": {
  20. "max_primary_shard_size": "50gb"
  21. }
  22. }
  23. },
  24. "warm": {
  25. "min_age": "30d",
  26. "actions": {
  27. "shrink": {
  28. "number_of_shards": 1
  29. },
  30. "forcemerge": {
  31. "max_num_segments": 1
  32. }
  33. }
  34. },
  35. "cold": {
  36. "min_age": "60d",
  37. "actions": {
  38. "searchable_snapshot": {
  39. "snapshot_repository": "found-snapshots"
  40. }
  41. }
  42. },
  43. "frozen": {
  44. "min_age": "90d",
  45. "actions": {
  46. "searchable_snapshot": {
  47. "snapshot_repository": "found-snapshots"
  48. }
  49. }
  50. },
  51. "delete": {
  52. "min_age": "735d",
  53. "actions": {
  54. "delete": {}
  55. }
  56. }
  57. }
  58. }
  59. }
  60. ----
  61. // end::fleet[]
  62. // tag::custom[]
  63. To create a policy in {kib}, open the main menu and go to **Stack Management >
  64. Index Lifecycle Policies**. Click **Create policy**.
  65. You can also use the <<ilm-put-lifecycle,update lifecycle policy API>>.
  66. include::{es-repo-dir}/data-streams/set-up-a-data-stream.asciidoc[tag=ilm-policy-api-ex]
  67. // end::custom[]