<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic coldtofrozenscript in a Clustered Enviroment in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698873#M10396</link>
    <description>&lt;P&gt;Does anyone have an example of a&amp;nbsp;coldtofrozenscript to be deployed in a clustered enviorment, I'm weary of having duplicate buckets etc?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Sep 2024 08:32:28 GMT</pubDate>
    <dc:creator>Rhidian</dc:creator>
    <dc:date>2024-09-12T08:32:28Z</dc:date>
    <item>
      <title>coldtofrozenscript in a Clustered Enviroment</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698873#M10396</link>
      <description>&lt;P&gt;Does anyone have an example of a&amp;nbsp;coldtofrozenscript to be deployed in a clustered enviorment, I'm weary of having duplicate buckets etc?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 08:32:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698873#M10396</guid>
      <dc:creator>Rhidian</dc:creator>
      <dc:date>2024-09-12T08:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: coldtofrozenscript in a Clustered Enviroment</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698876#M10397</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231246"&gt;@Rhidian&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you have to move only data indexed on that Indexer and not replicated data.&lt;/P&gt;&lt;P&gt;You can distinguish them by the folder name:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;locally indexed data have folder names that start with db_&lt;/LI&gt;&lt;LI&gt;replicated data data have folder names that start with rt_&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In this way, you can create your own script.&lt;/P&gt;&lt;P&gt;Obviously only folders in the cold folder of each index.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 08:47:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698876#M10397</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-12T08:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: coldtofrozenscript in a Clustered Enviroment</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698895#M10398</link>
      <description>&lt;P&gt;Thanks. So somthing simple like this should work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#!/bin/bash

# coldToFrozen script for Splunk

# Arguments:
# $1 - Path to the cold bucket
# $2 - Path to the frozen bucket

COLD_BUCKET_PATH="$1"
FROZEN_BUCKET_PATH="$2"

echo "Starting coldToFrozen transition..."

# Log paths for debugging
echo "Cold Bucket Path: $COLD_BUCKET_PATH"
echo "Frozen Bucket Path: $FROZEN_BUCKET_PATH"

# Ensure paths are not empty
if [ -z "$COLD_BUCKET_PATH" ] || [ -z "$FROZEN_BUCKET_PATH" ]; then
    echo "Error: Cold or Frozen bucket path is not provided."
    exit 1
fi

# Check if the cold bucket directory exists
if [ ! -d "$COLD_BUCKET_PATH" ]; then
    echo "Error: Cold bucket path does not exist."
    exit 1
fi

# Create frozen bucket directory if it does not exist
if [ ! -d "$FROZEN_BUCKET_PATH" ]; then
    echo "Creating frozen bucket directory at: $FROZEN_BUCKET_PATH"
    mkdir -p "$FROZEN_BUCKET_PATH"
fi

# Move files prefixed with 'db_' from cold to frozen
echo "Moving 'db_' files from cold to frozen..."
for file in "$COLD_BUCKET_PATH"/db_*; do
    if [ -f "$file" ]; then
        mv "$file" "$FROZEN_BUCKET_PATH"
        if [ $? -ne 0 ]; then
            echo "Error: Failed to move file $file to frozen storage."
            exit 1
        fi
    fi
done

echo "Data successfully moved to frozen storage."

exit 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 11:50:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698895#M10398</guid>
      <dc:creator>Rhidian</dc:creator>
      <dc:date>2024-09-12T11:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: coldtofrozenscript in a Clustered Enviroment</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698899#M10399</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231246"&gt;@Rhidian&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;it seems correct, even if I'm not a script developer, you have only to test it.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 11:55:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698899#M10399</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-12T11:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: coldtofrozenscript in a Clustered Enviroment</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698906#M10400</link>
      <description>&lt;P&gt;Let Splunk manage the buckets for you.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.3.0/Indexer/Automatearchiving" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.3.0/Indexer/Automatearchiving&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Currently your script doesn't seem to have any filter on cold and would appear to copy all files so is this a one time execution as this on a cron would seem to copy over and over again creating a storage issue.&lt;/P&gt;&lt;P&gt;Benefits of Splunk Management&lt;/P&gt;&lt;P&gt;1) Frozen reduces storage as the raw data in compressed format is stored, the IDX files are stripped away&lt;/P&gt;&lt;P&gt;2) Easy methods to reintroduce Frozen data back to thawed&lt;/P&gt;&lt;P&gt;3) Expands automatically if you have IDX clustering&lt;/P&gt;&lt;P&gt;4) Your not duplicating storage of Cold qualified time spans in a manual frozen folder&lt;/P&gt;&lt;P&gt;5) Folder management and creation is automatic&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 13:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698906#M10400</guid>
      <dc:creator>dural_yyz</dc:creator>
      <dc:date>2024-09-12T13:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: coldtofrozenscript in a Clustered Enviroment</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698909#M10401</link>
      <description>&lt;P&gt;This is to be used as&amp;nbsp;coldToFrozenScript essentially I'm trying to avoid having multiple copies of my bucket. As per the guidance:&lt;/P&gt;&lt;P&gt;"In an Indexer cluster, each individual peer node rolls its buckets to frozen, in the same way that a non-clustered indexer does; that is, based on its own set of configurations. Because all peers in a cluster should be configured identically, all copies of a bucket should roll to frozen at approximately the same time."&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 13:27:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/coldtofrozenscript-in-a-Clustered-Enviroment/m-p/698909#M10401</guid>
      <dc:creator>Rhidian</dc:creator>
      <dc:date>2024-09-12T13:27:13Z</dc:date>
    </item>
  </channel>
</rss>

