From d240fca72108b4e8af2d11454cf83567665a6326 Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Tue, 3 Jun 2025 08:45:04 -0500 Subject: [PATCH] remove usage of temp file --- .../tools/sbin/so-elasticsearch-indices-growth | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-indices-growth b/salt/elasticsearch/tools/sbin/so-elasticsearch-indices-growth index 7e31a5eed..3381947eb 100644 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-indices-growth +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-indices-growth @@ -51,8 +51,6 @@ indexes=$(echo "$indexes_result" | tail -n +2 | cut -d',' -f4 | grep -v '^$' | g printf "%-50s %15s %15s %15s\n" "Index Name" "Last 24hr (GB)" "Last 7d (GB)" "Last 30d (GB)" printf "%-50s %15s %15s %15s\n" "$(printf '%.0s-' {1..50})" "$(printf '%.0s-' {1..15})" "$(printf '%.0s-' {1..15})" "$(printf '%.0s-' {1..15})" -temp_results=$(mktemp) - for index in $indexes; do [[ -z "$index" ]] && continue current_query="from(bucket: \"telegraf/so_long_term\") @@ -109,10 +107,7 @@ for index in $indexes; do "$index" \ "$growth_24h_gb" \ "$growth_7d_gb" \ - "$growth_30d_gb" >> "$temp_results" + "$growth_30d_gb" fi -done - -sort -t'|' -k1,1nr "$temp_results" | cut -d'|' -f2- -rm -f "$temp_results" +done | sort -t'|' -k1,1nr | cut -d'|' -f2-