<?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: Change source and sourcetype in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61637#M12293</link>
    <description>&lt;P&gt;Probably the easiest way is to used the oneshot command:&lt;/P&gt;

&lt;P&gt;splunk add oneshot raw.logs -host myhost -index myindex -sourcetype correct_sourcetype&lt;/P&gt;

&lt;P&gt;You can use whatever else you want - index through web interface with 4.3, use a monitor stanza on a file ...&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jan 2012 22:13:23 GMT</pubDate>
    <dc:creator>bojanz</dc:creator>
    <dc:date>2012-01-31T22:13:23Z</dc:date>
    <item>
      <title>Change source and sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61634#M12290</link>
      <description>&lt;P&gt;I have several thousand events that I want to change the source and sourcetype.  I started putting them in the index with one source type then realized that it should have been something else.&lt;/P&gt;

&lt;P&gt;I want to go back and change the old source type info on the old events so that they have the same sourcetype as the new records.&lt;/P&gt;

&lt;P&gt;Anyone know how to do this???&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2012 21:11:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61634#M12290</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2012-01-31T21:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Change source and sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61635#M12291</link>
      <description>&lt;P&gt;You cannot change it once it has been indexed.&lt;/P&gt;

&lt;P&gt;However, what you can do is the following:&lt;/P&gt;

&lt;P&gt;1) Export the logs with incorrect sourcetype so you have the raw, original logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk search "index=myindex sourcetype=wrong_source_type" -maxour 0 &amp;gt; raw.logs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) Delete the logs with incorrect sourcetype. You have to add the delete role to your account before doing this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex sourcetype=wrong_source_type | delete
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3) Reindex the raw logs with the correct sourcetype.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2012 21:31:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61635#M12291</guid>
      <dc:creator>bojanz</dc:creator>
      <dc:date>2012-01-31T21:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Change source and sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61636#M12292</link>
      <description>&lt;P&gt;this will probably work for me&lt;/P&gt;

&lt;P&gt;If i might, Can I trouble you for the command to reindex the raw.logs file ???&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2012 22:02:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61636#M12292</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2012-01-31T22:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Change source and sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61637#M12293</link>
      <description>&lt;P&gt;Probably the easiest way is to used the oneshot command:&lt;/P&gt;

&lt;P&gt;splunk add oneshot raw.logs -host myhost -index myindex -sourcetype correct_sourcetype&lt;/P&gt;

&lt;P&gt;You can use whatever else you want - index through web interface with 4.3, use a monitor stanza on a file ...&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2012 22:13:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61637#M12293</guid>
      <dc:creator>bojanz</dc:creator>
      <dc:date>2012-01-31T22:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change source and sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61638#M12294</link>
      <description>&lt;P&gt;thanks for the help&lt;/P&gt;

&lt;P&gt;Here is a good link to this problem&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/22421/how-to-export-large-volume-of-raw-data-out-of-a-index" target="_blank"&gt;http://splunk-base.splunk.com/answers/22421/how-to-export-large-volume-of-raw-data-out-of-a-index&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;here is the code I used to copy out the data&lt;/P&gt;

&lt;P&gt;./splunk search "index=firewall_juniper" earliest=1/26/2012:0:0:0 latest=02/01/2012:09:08:15 -preview 0 -maxout 0 -output rawdata &amp;gt;../juniper_raw.logs&lt;/P&gt;

&lt;P&gt;then I used the same search to delete the records then I did the oneshot on the juniper_raw.logs into the firewall_juniper index with the right host, source and sorcetype info&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:22:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61638#M12294</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2020-09-28T10:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Change source and sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61639#M12295</link>
      <description>&lt;P&gt;Came across this post trying to correct sourcetype errors in my instance.  there is an error in the accepted answer, the command should be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk search "index=myindex sourcetype=wrong_source_type" -maxout 0 &amp;gt; raw.logs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can then impart the file with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk add oneshot raw.logs -sourcetype mysourcetype -index myindex -host myhostparam
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But be aware that this will set the "source" for that sourcetype to the "raw.logs" location... so make sure you're not using &lt;CODE&gt;source=&lt;/CODE&gt; in your filters or it will miss those bulk indexed files.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2015 22:53:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61639#M12295</guid>
      <dc:creator>alaorath</dc:creator>
      <dc:date>2015-03-16T22:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Change source and sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61640#M12296</link>
      <description>&lt;P&gt;You can also use 'rename-source' to rename the source. i.e.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk add oneshot raw.logs -sourcetype mysourcetype -index myindex -host myhost -rename-source mysource
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Apr 2015 10:27:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61640#M12296</guid>
      <dc:creator>samcogheil</dc:creator>
      <dc:date>2015-04-26T10:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Change source and sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61641#M12297</link>
      <description>&lt;P&gt;in our clustered environment where we should execute these commands in cluster master or in any indexer.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 15:50:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-source-and-sourcetype/m-p/61641#M12297</guid>
      <dc:creator>Prakash493</dc:creator>
      <dc:date>2019-07-09T15:50:42Z</dc:date>
    </item>
  </channel>
</rss>

