Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding in new ism policies #154

Merged
merged 3 commits into from
Dec 13, 2024
Merged

adding in new ism policies #154

merged 3 commits into from
Dec 13, 2024

Conversation

JasonTheMain
Copy link
Contributor

Changes proposed in this pull request:

  • ISM policy for old indexs and new ones, this policy does readonly on rollover and transitions when it gets old

Security considerations

None

@JasonTheMain JasonTheMain requested a review from a team as a code owner December 13, 2024 16:46
@@ -116,7 +116,8 @@ echo "--- License"
<% end %>

echo "--- Creating ISM policy"
curl -XPUT ${CA} ${CERT} ${KEY} ${BASEURL}/_plugins/_ism/policies/logs-app-rollover_policy -H 'Content-Type: application/json' -d'{"policy":{"description":"Rollover to a new index when age or size becomes our target","default_state":"Rollover","states":[{"name":"Rollover","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"rollover":{"min_index_age":"'${INDEX_AGE}'","min_primary_shard_size":"'${DOCUMENT_SIZE}'","copy_alias":false}}],"transitions":[]}],"ism_template":[{"index_patterns":["logs-app-*"],"priority":100}]}}'
curl -XPUT ${CA} ${CERT} ${KEY} ${BASEURL}/_plugins/_ism/policies/logs-app-rollover_policy -H 'Content-Type: application/json' -d'{"policy":{"description":"Rollover to a new index when age or size becomes our target","default_state":"Rollover","states":[{"name":"Rollover","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"rollover":{"min_index_age":"'${INDEX_AGE}'","min_primary_shard_size":"'${DOCUMENT_SIZE}'","copy_alias":false}},{"read_only":{}}],"transitions":[{"state_name":"Old_index","conditions":{"min_index_age":"30d"}}]},{"name":"Old_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"force_merge":{"max_num_segments":1}}],"transitions":[{"state_name":"Delete_index","conditions":{"min_index_age":"365d"}}]},{"name":"Delete_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"delete":{}}],"transitions":[]}],"ism_template":[{"index_patterns":["logs-app-*"],"priority":100}]}}'
curl -XPUT ${CA} ${CERT} ${KEY} ${BASEURL}/_plugins/_ism/policies/logs_age_policy -H 'Content-Type: application/json' -d'{"policy":{"policy_id":"logs_app_policy","description":"age out old indexs","default_state":"Old_index","states":[{"name":"Old_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"force_merge":{"max_num_segments":1}}],"transitions":[{"state_name":"Delete_index","conditions":{"min_index_age":"365d"}}]},{"name":"Delete_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"delete":{}}],"transitions":[]}],"ism_template":null}}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment above this line explaining the need for two policies?

@@ -116,7 +116,8 @@ echo "--- License"
<% end %>

echo "--- Creating ISM policy"
curl -XPUT ${CA} ${CERT} ${KEY} ${BASEURL}/_plugins/_ism/policies/logs-app-rollover_policy -H 'Content-Type: application/json' -d'{"policy":{"description":"Rollover to a new index when age or size becomes our target","default_state":"Rollover","states":[{"name":"Rollover","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"rollover":{"min_index_age":"'${INDEX_AGE}'","min_primary_shard_size":"'${DOCUMENT_SIZE}'","copy_alias":false}}],"transitions":[]}],"ism_template":[{"index_patterns":["logs-app-*"],"priority":100}]}}'
curl -XPUT ${CA} ${CERT} ${KEY} ${BASEURL}/_plugins/_ism/policies/logs-app-rollover_policy -H 'Content-Type: application/json' -d'{"policy":{"description":"Rollover to a new index when age or size becomes our target","default_state":"Rollover","states":[{"name":"Rollover","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"rollover":{"min_index_age":"'${INDEX_AGE}'","min_primary_shard_size":"'${DOCUMENT_SIZE}'","copy_alias":false}},{"read_only":{}}],"transitions":[{"state_name":"Old_index","conditions":{"min_index_age":"30d"}}]},{"name":"Old_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"force_merge":{"max_num_segments":1}}],"transitions":[{"state_name":"Delete_index","conditions":{"min_index_age":"365d"}}]},{"name":"Delete_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"delete":{}}],"transitions":[]}],"ism_template":[{"index_patterns":["logs-app-*"],"priority":100}]}}'
curl -XPUT ${CA} ${CERT} ${KEY} ${BASEURL}/_plugins/_ism/policies/logs_age_policy -H 'Content-Type: application/json' -d'{"policy":{"policy_id":"logs_app_policy","description":"age out old indexs","default_state":"Old_index","states":[{"name":"Old_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"force_merge":{"max_num_segments":1}}],"transitions":[{"state_name":"Delete_index","conditions":{"min_index_age":"365d"}}]},{"name":"Delete_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"delete":{}}],"transitions":[]}],"ism_template":null}}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
curl -XPUT ${CA} ${CERT} ${KEY} ${BASEURL}/_plugins/_ism/policies/logs_age_policy -H 'Content-Type: application/json' -d'{"policy":{"policy_id":"logs_app_policy","description":"age out old indexs","default_state":"Old_index","states":[{"name":"Old_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"force_merge":{"max_num_segments":1}}],"transitions":[{"state_name":"Delete_index","conditions":{"min_index_age":"365d"}}]},{"name":"Delete_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"delete":{}}],"transitions":[]}],"ism_template":null}}'
curl -XPUT ${CA} ${CERT} ${KEY} ${BASEURL}/_plugins/_ism/policies/logs_age_policy -H 'Content-Type: application/json' -d'{"policy":{"policy_id":"logs_app_policy","description":"age out old indexes","default_state":"Old_index","states":[{"name":"Old_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"force_merge":{"max_num_segments":1}}],"transitions":[{"state_name":"Delete_index","conditions":{"min_index_age":"365d"}}]},{"name":"Delete_index","actions":[{"retry":{"count":3,"backoff":"exponential","delay":"1m"},"delete":{}}],"transitions":[]}],"ism_template":null}}'

@JasonTheMain JasonTheMain merged commit 7a2c214 into main Dec 13, 2024
@JasonTheMain JasonTheMain deleted the ISM branch December 13, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants