From b69d453a68e6601164d74ddf9df793821ee7eb6e Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Thu, 6 Nov 2025 14:24:29 -0600 Subject: [PATCH 1/3] typo --- .../tools/sbin/so-elasticsearch-retention-estimate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate b/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate index 4c34d3a02..d4ab4bdc5 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate @@ -206,7 +206,7 @@ fail() { exit 1 } -echo -e "\nDISCLAIMER: Script output is based on current data patterns, but are approximations soley intended to assist with getting a general ILM policy configured." +echo -e "\nDISCLAIMER: Script output is based on current data patterns, but are approximations solely intended to assist with getting a general ILM policy configured." ORG_ID=$(lookup_org_id) [ -n "$ORG_ID" ] || fail "Unable to resolve InfluxDB org id" From 35c7fc06d7b86844d5c1db3de581480840aaa788 Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Thu, 6 Nov 2025 14:24:58 -0600 Subject: [PATCH 2/3] fix bug showing duplicate backing indices in recommendations --- .../tools/sbin/so-elasticsearch-retention-estimate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate b/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate index d4ab4bdc5..55a2d5da7 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate @@ -756,7 +756,7 @@ if [ "$should_trigger_recommendations" = true ]; then ilm_output=$(so-elasticsearch-query "${index}/_ilm/explain" --fail 2>/dev/null) || true if [ -n "$ilm_output" ]; then - policy=$(echo "$ilm_output" | jq -r ".indices.\"$index\".policy // empty" 2>/dev/null) + policy=$(echo "$ilm_output" | jq -r '.indices | to_entries | .[0].value.policy // empty' 2>/dev/null) fi if [ -n "$policy" ] && [ -n "${policy_ages[$policy]:-}" ]; then delete_min_age=${policy_ages[$policy]} From 1eb4b5379a492c41ec40aa4f3e617c5b3e39d1d8 Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Thu, 6 Nov 2025 14:25:25 -0600 Subject: [PATCH 3/3] show 30d scheduled deletions or 7d scheduled deletions depending on what historical data is available --- .../tools/sbin/so-elasticsearch-retention-estimate | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate b/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate index 55a2d5da7..a215e35a4 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-retention-estimate @@ -1024,8 +1024,12 @@ else if [ "$ilm_indices_immediate" -gt 0 ]; then echo -e "${BOLD}Deleting now:${NC} $ilm_indices_immediate indices (~${ilm_delete_immediate_gb} GB, $ilm_shards_immediate shards)" fi - if [ "$ilm_indices_7d" -gt 0 ]; then - echo -e "${BOLD}Storage to be freed (7d):${NC} $ilm_indices_7d indices (~${ilm_delete_7d_gb} GB, $ilm_shards_7d shards)" + if [ "$ilm_indices_30d" -gt 0 ]; then + if [ "$ilm_delete_scheduled_30d" -gt 0 ] && [ "$ilm_indices_scheduled_30d" -gt 0 ]; then + echo -e "${BOLD}Storage to be freed (30d):${NC} $ilm_indices_30d indices (~${ilm_delete_30d_gb} GB, $ilm_shards_30d shards)" + elif [ "$ilm_indices_7d" -gt 0 ]; then + echo -e "${BOLD}Storage to be freed (7d):${NC} $ilm_indices_7d indices (~${ilm_delete_7d_gb} GB, $ilm_shards_7d shards)" + fi fi log_title "LOG" "Retention Projection"