<?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 regularly write filtered events to a new index? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294102#M55905</link>
    <description>&lt;P&gt;What should I do ?&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2017 11:12:37 GMT</pubDate>
    <dc:creator>xsstest</dc:creator>
    <dc:date>2017-10-13T11:12:37Z</dc:date>
    <item>
      <title>How to regularly write filtered events to a new index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294098#M55901</link>
      <description>&lt;P&gt;if I have an index &lt;CODE&gt;test&lt;/CODE&gt;, the index has too many events, I need to filter by keyword and write the result to the index &lt;CODE&gt;Useful_logs&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;for example:&lt;/P&gt;

&lt;P&gt;Filter conditions:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=test sourcetype=abc   "login"  "user" "deviceId"&lt;/CODE&gt;  &lt;/P&gt;

&lt;P&gt;then at the zero of every day，filter the events of the previous day&lt;/P&gt;

&lt;P&gt;Write the filtered event to index &lt;CODE&gt;Useful_logs&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Finally, I can use &lt;CODE&gt;index=Useful_logs&lt;/CODE&gt; to search for the log I want.&lt;/P&gt;

&lt;P&gt;Of course, maybe some friends will let me configure the "transforms.conf" file.&lt;BR /&gt;
But I want to keep all the logs of the test index, but also write useful logs to the new index  （the Useful_logs index）.&lt;/P&gt;

&lt;P&gt;So what should I do?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 15:55:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294098#M55901</guid>
      <dc:creator>xsstest</dc:creator>
      <dc:date>2017-10-11T15:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to regularly write filtered events to a new index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294099#M55902</link>
      <description>&lt;P&gt;Use the summary index?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 15:57:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294099#M55902</guid>
      <dc:creator>xsstest</dc:creator>
      <dc:date>2017-10-11T15:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to regularly write filtered events to a new index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294100#M55903</link>
      <description>&lt;P&gt;Hi  xsstest,&lt;BR /&gt;
reindexing already indexed logs isn't a good idea because you have double license consuption!&lt;/P&gt;

&lt;P&gt;If you can identify the logs you want using source or sourcetype, you can see that, also having many different events in your index, your search will be very quick.&lt;/P&gt;

&lt;P&gt;If you want anyway to put the selected logs in another index you could do two things:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;put the selected logs in a summary index,&lt;/LI&gt;
&lt;LI&gt;extract the selected logs and reindex them in the new index.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;First solution has the advantage that you don't have double license consuption and that your searches will be very performant, but in this way you have ro rebuild all your searches and field extraction because you have to use a differtent syntax in searches.&lt;BR /&gt;
To have this you have to run something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test sourcetype=abc "login" "user" "deviceId"
| table _time _raw
| tscollect namespace=Useful_logs
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to access this logs use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count FROM Useful_logs GROUPBY _time _raw | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To run the second solution run your search &lt;CODE&gt;index=test sourcetype=abc "login" "user" "deviceId"&lt;/CODE&gt; and then download results in raw format that you can newly ingest in the new index.&lt;BR /&gt;
This second solution has double license consuption but your searches will be the same (only different index).&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 16:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294100#M55903</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-10-11T16:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to regularly write filtered events to a new index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294101#M55904</link>
      <description>&lt;P&gt;Why not simply setup an &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.0/Knowledge/Abouteventtypes"&gt;eventtype&lt;/A&gt; that returns just your useful data?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 16:54:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294101#M55904</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-10-11T16:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to regularly write filtered events to a new index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294102#M55905</link>
      <description>&lt;P&gt;What should I do ?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 11:12:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294102#M55905</guid>
      <dc:creator>xsstest</dc:creator>
      <dc:date>2017-10-13T11:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to regularly write filtered events to a new index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294103#M55906</link>
      <description>&lt;P&gt;The simplest is to define an eventtype, as suggested, and use that for searching your useful logs. I'd recommend &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.0/Knowledge/Abouteventtypes"&gt;reading up on it&lt;/A&gt; and applying it to your problem to see if that helps. &lt;BR /&gt;
If that doesn't solve your problem, please describe your problem in more detail.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 23:26:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-regularly-write-filtered-events-to-a-new-index/m-p/294103#M55906</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-10-13T23:26:41Z</dc:date>
    </item>
  </channel>
</rss>

