<?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 Re: how to export/import events from indexes? in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17894#M308</link>
    <description>&lt;P&gt;Great Post!&lt;/P&gt;

&lt;P&gt;A couple of corrections during import (at least with 4.2.5):&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;add the bucket dir in the import line, thus: &lt;/P&gt;

&lt;P&gt;/opt/splunk/var/lib/splunk/defaultdb/db/hot_v1_0&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;after restart, I didn't get prompted, perhaps there's a new fsck that happens automatically (you'll see in splunkd.log the recovery occur)&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Tue, 13 Dec 2011 09:23:23 GMT</pubDate>
    <dc:creator>bchen</dc:creator>
    <dc:date>2011-12-13T09:23:23Z</dc:date>
    <item>
      <title>how to export/import events from indexes?</title>
      <link>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17892#M306</link>
      <description>&lt;P&gt;I want to move some events from an indexer to another, for a particular period of time.&lt;BR /&gt;
I saw that there are some importtool and exportool commands in $SPLUNK_HOME/bin&lt;BR /&gt;
how to use them ?&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2011 01:39:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17892#M306</guid>
      <dc:creator>mataharry</dc:creator>
      <dc:date>2011-05-27T01:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to export/import events from indexes?</title>
      <link>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17893#M307</link>
      <description>&lt;P&gt;How to export/import selectively data from an indexer to another.&lt;/P&gt;

&lt;P&gt;Here is the example for the defaultdb index (the main index)&lt;BR /&gt;
with $SPLUNK_HOME = /opt/splunk&lt;BR /&gt;
and a time period from April 10th 00:00 to April 11th 00:00 GMT (equivalent to 1302393600 to 1302480000 epoch time)&lt;/P&gt;

&lt;P&gt;1 - &lt;STRONG&gt;roll the hot buckets to warm&lt;/STRONG&gt; on the initial indexer &lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
cd /opt/splunk/bin&lt;BR /&gt;
./splunk _internal call /data/indexes/defaultdb/roll-hot-buckets -auth admin:changeme&lt;BR /&gt;
&lt;/PRE&gt;&lt;BR /&gt;
specify the correct db name, and password&lt;/P&gt;

&lt;P&gt;2- &lt;STRONG&gt;identify the buckets&lt;/STRONG&gt; containing data for your time period.&lt;/P&gt;

&lt;P&gt;The dates are in epoch time UTC in the filename, in the reverse order.&lt;BR /&gt;
the filename is db_recentevent_oldestevent_bucketuniquenumber.&lt;BR /&gt;
You can use &lt;A href="http://www.epochconverter.com/" target="_blank"&gt;http://www.epochconverter.com/&lt;/A&gt; to check&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
example :&lt;BR /&gt;
/opt/splunk/var/lib/splunk/defaultdb/db/db_1305913172_1301920239_29/&lt;BR /&gt;
contains data for the period of&lt;BR /&gt;
to    1301920239 = GMT: Mon, 04 Apr 2011 12:30:39 GMT&lt;BR /&gt;
from 1305913172 = GMT: Fri, 20 May 2011 17:39:32 GMT&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;3 - &lt;STRONG&gt;export the events&lt;/STRONG&gt; for the index and the period you need&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
usage : exporttool db_directory exportfile [-et &lt;EARLIEST_TIME_UTC&gt;] [-lt &lt;LATEST_TIME_UTC&gt;] [-csv] [export_search]&lt;BR /&gt;
example :&lt;BR /&gt;
cd /opt/splunk/bin&lt;BR /&gt;
./splunk cmd exporttool /opt/splunk/var/lib/splunk/defaultdb/db/db_1305913172_1301920239_29/  /myexportpath/export1.csv  -et 1302393600 -lt 1302480000 -csv&lt;BR /&gt;
&lt;/LATEST_TIME_UTC&gt;&lt;/EARLIEST_TIME_UTC&gt;&lt;/PRE&gt;&lt;BR /&gt;
&lt;EM&gt;If needed, you can also add a search as last parameter.&lt;/EM&gt;&lt;BR /&gt;
Check that an export file was created.&lt;BR /&gt;
Repeat for each buckets containing data of the good period and change the export file.&lt;BR /&gt;
If you want to run the export over all the buckets, use a loop command.&lt;/P&gt;

&lt;P&gt;4 - &lt;STRONG&gt;import each file&lt;/STRONG&gt; into the new indexer, in the proper destination index&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
usage : importtool &lt;BR /&gt;
&lt;DATABASE_PATH&gt; &lt;CSV_FILE&gt;&lt;BR /&gt;
example :&lt;BR /&gt;
cd /opt/splunk/bin&lt;BR /&gt;
./splunk cmd importtool /opt/splunk/var/lib/splunk/defaultdb/db /myexportpath/export1.csv&lt;BR /&gt;
"Successfully imported 71615 events into the bucket.&lt;BR /&gt;
Please ensure this bucket resides in a valid index and restart Splunk to recognize the new events."&lt;BR /&gt;
&lt;/CSV_FILE&gt;&lt;/DATABASE_PATH&gt;&lt;/PRE&gt;&lt;BR /&gt;
Restart to have splunk detecting the new data and recalculate the metadata.&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
example :&lt;BR /&gt;
./splunk restart&lt;BR /&gt;
....&lt;BR /&gt;
Perform recovery now? [y/n] y&lt;BR /&gt;
    Recovering (across all data)...&lt;BR /&gt;
    bucket=opt/splunk/var/lib/splunk/defaultdb/db/db_1306285067_1305920377_54 count mismatch tsidx=2525 source-metadata=2524, repairing...&lt;BR /&gt;
    Done&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:37:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17893#M307</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2020-09-28T09:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to export/import events from indexes?</title>
      <link>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17894#M308</link>
      <description>&lt;P&gt;Great Post!&lt;/P&gt;

&lt;P&gt;A couple of corrections during import (at least with 4.2.5):&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;add the bucket dir in the import line, thus: &lt;/P&gt;

&lt;P&gt;/opt/splunk/var/lib/splunk/defaultdb/db/hot_v1_0&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;after restart, I didn't get prompted, perhaps there's a new fsck that happens automatically (you'll see in splunkd.log the recovery occur)&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 13 Dec 2011 09:23:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17894#M308</guid>
      <dc:creator>bchen</dc:creator>
      <dc:date>2011-12-13T09:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to export/import events from indexes?</title>
      <link>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17895#M309</link>
      <description>&lt;P&gt;When I try  export , it gives me the following :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[root@test-machine]# /opt/splunk/bin/splunk cmd exporttool ../../db_1409651281_1409651235_37/ /export.csv -et 1409651235 -lt 1409651281 -csv
Using logging configuration at /opt/splunk/etc/log-cmdline.cfg.
no events
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What does this shows no events - But actually events are present in this bucket.&lt;BR /&gt;
I'm using splunk v6.2&lt;/P&gt;</description>
      <pubDate>Sat, 22 Nov 2014 10:00:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17895#M309</guid>
      <dc:creator>splunker12er</dc:creator>
      <dc:date>2014-11-22T10:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to export/import events from indexes?</title>
      <link>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17896#M310</link>
      <description>&lt;P&gt;Can someone describe the syntax for this:&lt;BR /&gt;
"If needed, you can also add a search as last parameter." ?&lt;/P&gt;

&lt;P&gt;it looks like if I dd at the end 'some_string' it will filter based on that.&lt;/P&gt;

&lt;P&gt;However if I do 'sourcetype=some_source' it returns nothing&lt;/P&gt;

&lt;P&gt;Does this mean that I cannot use source type to search, or is my syntax incorrect?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2014 22:52:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17896#M310</guid>
      <dc:creator>exabeamer</dc:creator>
      <dc:date>2014-11-25T22:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to export/import events from indexes?</title>
      <link>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17897#M311</link>
      <description>&lt;P&gt;Very helpful post.  However, when I run the '_internal call...' command, I do return data, but I find no epoch times listed in the "s:key name=" lines.  Can  you provide the specific line I'm looking for?  &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2015 20:25:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/how-to-export-import-events-from-indexes/m-p/17897#M311</guid>
      <dc:creator>timmy13</dc:creator>
      <dc:date>2015-04-23T20:25:48Z</dc:date>
    </item>
  </channel>
</rss>

