<?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 copy/reindex logs to another index continuously in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698770#M237255</link>
    <description>&lt;P&gt;Different retention periods is the textbook case of splitting data between different indexes. So instead of copying you might consider simply sending some of your data to one index and the rest (the error logs) to another index. Otherwise - if you copy the events from one index to another - those events will be counted twice against your license which doesn't make much sense.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Sep 2024 12:18:46 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-09-11T12:18:46Z</dc:date>
    <item>
      <title>How to copy/reindex logs to another index continuously</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698765#M237252</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We have an index say index1 with a log retention of 7 days where we receive logs for different applications. Now we have a requirement to copy all ERROR logs from an application to another index, say index2 continuously.&amp;nbsp; The intention here is to have index2 with a higher retention so we can have access to the error logs for longer period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best way to implement such a mechanism. Its okay to run this job every day, or every 6 hour or so. Would be best to retain all fields and field extractions in logs in target index as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 11:29:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698765#M237252</guid>
      <dc:creator>jpillai</dc:creator>
      <dc:date>2024-09-11T11:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy/reindex logs to another index continuously</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698769#M237254</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/48465"&gt;@jpillai&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;do you want to divide logs between the two indexes or copy a part of logs (ERRORS) in the second one?&lt;/P&gt;&lt;P&gt;in this second case you pay twice the license.&lt;/P&gt;&lt;P&gt;Anyway, if you want to divide logs, you have to find the regex to identify logs fo index2 and put these props.conf and transforms.conf in your indexes or (if present) on Heavy Forwarders:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# etc/system/local/transforms.conf 
[overrideindex]
DEST_KEY =_MetaData:Index
REGEX = .
FORMAT = my_new_index

#etc/system/local/props.conf 
[mysourcetype]
TRANSFORMS-index = overrideindex&lt;/LI-CODE&gt;&lt;P&gt;the REGEX to use is the one you identified.&lt;/P&gt;&lt;P&gt;If instead you want to copy ERROR logs in the second index, you can use the collect command, but you pay twice the license (using the original sourcetype) or you must use the stash sourcetype (in this case you don't pay twice the license.&lt;/P&gt;&lt;P&gt;In othe words, you have to schedule a search like the following (if "ERROR" is the string to identify logs to copy):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 "ERROR"
| collect index=index2&lt;/LI-CODE&gt;&lt;P&gt;My hint is to override index value for the logs that you want to index in index2.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 12:03:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698769#M237254</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-11T12:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy/reindex logs to another index continuously</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698770#M237255</link>
      <description>&lt;P&gt;Different retention periods is the textbook case of splitting data between different indexes. So instead of copying you might consider simply sending some of your data to one index and the rest (the error logs) to another index. Otherwise - if you copy the events from one index to another - those events will be counted twice against your license which doesn't make much sense.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 12:18:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698770#M237255</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-09-11T12:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy/reindex logs to another index continuously</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698774#M237257</link>
      <description>&lt;P&gt;The reason I need to ''copy the logs instead of splitting is that, there are some searches thats using index1 for searching the same data.&amp;nbsp; So we still need to support that dependancy. As the log volume thats getting copied is relatively small, the additional license usage is not a major issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like scheduling search with collect is what fits the requirement we have&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 12:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698774#M237257</guid>
      <dc:creator>jpillai</dc:creator>
      <dc:date>2024-09-11T12:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy/reindex logs to another index continuously</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698776#M237259</link>
      <description>&lt;P&gt;The reason I need to ''copy the logs instead of splitting is that, there are some searches thats using index1 for searching the same data.&amp;nbsp; So we still need to support that dependancy. As the log volume thats getting copied is relatively small, the additional license usage is not a major issue.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 12:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698776#M237259</guid>
      <dc:creator>jpillai</dc:creator>
      <dc:date>2024-09-11T12:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to copy/reindex logs to another index continuously</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698778#M237261</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/48465"&gt;@jpillai&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;ok, my hint is to evaluate the effort to cheng the searches that use these indexes.&lt;/P&gt;&lt;P&gt;Anyway, let us know if we can help you more, or, please, accept one answer for the other people of Community.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 12:58:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-copy-reindex-logs-to-another-index-continuously/m-p/698778#M237261</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-09-11T12:58:43Z</dc:date>
    </item>
  </channel>
</rss>

