<?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 coldToFrozenDir per index in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/coldToFrozenDir-per-index/m-p/55757#M10904</link>
    <description>&lt;P&gt;I was running a cold to frozen script that moved the forzen files into a separate directory per index. &lt;/P&gt;

&lt;P&gt;/opt/splunk/bin/compressedExport.sh &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( cd "$1" &amp;amp;&amp;amp; gzip *.tsidx )
SPATH=`echo $1 |sed 's/^\/var\/splunk\/lib\/splunk\/\(.*\/\)db.*$/\1/'`
mkdir -p /var/splunk/archive/$SPATH
cp -r "$1" /var/splunk/archive/$SPATH  #replace this with your archive directory
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I would end up with the archives in &lt;BR /&gt;
/var/splunk/archive/index1&lt;BR /&gt;
/var/splunk/archive/index2 &lt;BR /&gt;
etc&lt;/P&gt;

&lt;P&gt;Is there an easy way to do something similar with the new coldtofrozen script.&lt;/P&gt;

&lt;P&gt;I tried setting&lt;BR /&gt;
coldToFrozenDir = /var/splunk/archive/ &lt;BR /&gt;
but all the archive files end up in the root of the /var/splunk/archive/ directory.&lt;/P&gt;

&lt;P&gt;Can I define coldToFrozenDir per index?&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2012 21:55:51 GMT</pubDate>
    <dc:creator>imacdonald2</dc:creator>
    <dc:date>2012-01-20T21:55:51Z</dc:date>
    <item>
      <title>coldToFrozenDir per index</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/coldToFrozenDir-per-index/m-p/55757#M10904</link>
      <description>&lt;P&gt;I was running a cold to frozen script that moved the forzen files into a separate directory per index. &lt;/P&gt;

&lt;P&gt;/opt/splunk/bin/compressedExport.sh &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( cd "$1" &amp;amp;&amp;amp; gzip *.tsidx )
SPATH=`echo $1 |sed 's/^\/var\/splunk\/lib\/splunk\/\(.*\/\)db.*$/\1/'`
mkdir -p /var/splunk/archive/$SPATH
cp -r "$1" /var/splunk/archive/$SPATH  #replace this with your archive directory
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I would end up with the archives in &lt;BR /&gt;
/var/splunk/archive/index1&lt;BR /&gt;
/var/splunk/archive/index2 &lt;BR /&gt;
etc&lt;/P&gt;

&lt;P&gt;Is there an easy way to do something similar with the new coldtofrozen script.&lt;/P&gt;

&lt;P&gt;I tried setting&lt;BR /&gt;
coldToFrozenDir = /var/splunk/archive/ &lt;BR /&gt;
but all the archive files end up in the root of the /var/splunk/archive/ directory.&lt;/P&gt;

&lt;P&gt;Can I define coldToFrozenDir per index?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2012 21:55:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/coldToFrozenDir-per-index/m-p/55757#M10904</guid>
      <dc:creator>imacdonald2</dc:creator>
      <dc:date>2012-01-20T21:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: coldToFrozenDir per index</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/coldToFrozenDir-per-index/m-p/55758#M10905</link>
      <description>&lt;P&gt;I found the answer, I looked at the &lt;BR /&gt;
/opt/splunk/bin/coldToFrozenExample.py script and saw it has this line at the end&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;destdir = os.path.join(ARCHIVE_DIR, indexname, os.path.basename(bucket))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So if I use that script it will put it in /ARCHIVE_DIR/index/&lt;/P&gt;

&lt;P&gt;So I made a copy of the script, edited it, added a new line at the top, so on unix systems it will execute as a python script&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/opt/splunk/bin/python
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and changing the ARCHIVE_DIR line at the top to &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ARCHIVE_DIR = '/var/splunk/archive'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;then added the following to the [default] in /opt/splunk/etc/system/local/indexes.conf &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;coldToFrozenScript = $SPLUNK_HOME/bin/coldToFrozen.py
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now it archives to a folder in /var/splunk/archive/indexname/&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jan 2012 00:05:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/coldToFrozenDir-per-index/m-p/55758#M10905</guid>
      <dc:creator>imacdonald2</dc:creator>
      <dc:date>2012-01-21T00:05:19Z</dc:date>
    </item>
  </channel>
</rss>

