ilm.asciidoc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. ////
  12. [source,console]
  13. --------------------------------------------------
  14. PUT /_snapshot/found-snapshots
  15. {
  16. "type": "fs",
  17. "settings": {
  18. "location": "my_backup_location"
  19. }
  20. }
  21. --------------------------------------------------
  22. // TESTSETUP
  23. ////
  24. [source,console]
  25. ----
  26. PUT _ilm/policy/logs
  27. {
  28. "policy": {
  29. "phases": {
  30. "hot": {
  31. "actions": {
  32. "rollover": {
  33. "max_primary_shard_size": "50gb"
  34. }
  35. }
  36. },
  37. "warm": {
  38. "min_age": "30d",
  39. "actions": {
  40. "shrink": {
  41. "number_of_shards": 1
  42. },
  43. "forcemerge": {
  44. "max_num_segments": 1
  45. }
  46. }
  47. },
  48. "cold": {
  49. "min_age": "60d",
  50. "actions": {
  51. "searchable_snapshot": {
  52. "snapshot_repository": "found-snapshots"
  53. }
  54. }
  55. },
  56. "frozen": {
  57. "min_age": "90d",
  58. "actions": {
  59. "searchable_snapshot": {
  60. "snapshot_repository": "found-snapshots"
  61. }
  62. }
  63. },
  64. "delete": {
  65. "min_age": "735d",
  66. "actions": {
  67. "delete": {}
  68. }
  69. }
  70. }
  71. }
  72. }
  73. ----
  74. // end::fleet[]
  75. // tag::custom[]
  76. To create a policy in {kib}, open the main menu and go to **Stack Management >
  77. Index Lifecycle Policies**. Click **Create policy**.
  78. You can also use the <<ilm-put-lifecycle,update lifecycle policy API>>.
  79. include::{es-repo-dir}/data-streams/set-up-a-data-stream.asciidoc[tag=ilm-policy-api-ex]
  80. // end::custom[]