<?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: Combine collect and delete commands in one pipe in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442357#M77086</link>
    <description>&lt;P&gt;Hello again @dreadangel,&lt;/P&gt;

&lt;P&gt;It's not possible to combine both collect &amp;amp; delete in the same search. You should use two different searches to achieve this. Step 1 move, step 2 delete.&lt;/P&gt;

&lt;P&gt;PS: deleting does not really delete the data, more info here : &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Delete"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Delete&lt;/A&gt; &lt;BR /&gt;
If you want to get rid of the data you should delete the entire index or the relevant buckets. &lt;/P&gt;

&lt;P&gt;If what you're doing is simply for replacing &lt;CODE&gt;status=low&lt;/CODE&gt; by &lt;CODE&gt;status=none&lt;/CODE&gt; you can easily do that via props and transforms as shown here &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Forwarding/Routeandfilterdatad"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/Forwarding/Routeandfilterdatad&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2019 09:24:53 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-05-08T09:24:53Z</dc:date>
    <item>
      <title>Combine collect and delete commands in one pipe</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442355#M77084</link>
      <description>&lt;P&gt;Attempting "move" some logs events to other index and after delete those events from original index:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="server_logs" status=low 
| eval old_raw=_raw 
| eval _raw=replace(_raw,"status=low", "status=none")
| collect index="old_logs_index" 
| eval _raw=old_raw 
| delete
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The pipe fails to execute - any thoughts if it's possible to combine &lt;STRONG&gt;collect&lt;/STRONG&gt; and &lt;STRONG&gt;delete&lt;/STRONG&gt; in one pipe ?  &lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 08:43:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442355#M77084</guid>
      <dc:creator>dreadangel</dc:creator>
      <dc:date>2019-05-08T08:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Combine collect and delete commands in one pipe</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442356#M77085</link>
      <description>&lt;P&gt;Few things to be test out before&lt;BR /&gt;
1. delete won't delete the data, but just hides from user&lt;BR /&gt;
2. delete key-word requires special capabilities. Not even "admin" role have "delete" capability by default. So you may need to add it separately to your user/role&lt;BR /&gt;
3. Any chance "NOT to" index the &lt;CODE&gt;status=low&lt;/CODE&gt; data into the &lt;CODE&gt;server_logs&lt;/CODE&gt; at first point? This is pretty easy at index time and can be redirected to another index&lt;BR /&gt;
4. You could produce a macro for old index and give it to users , where the content of macro is &lt;CODE&gt;index=server_logs status!=low&lt;/CODE&gt;&lt;BR /&gt;
5. Lastly, if its archive data, why you can't do in 2 steps? ie. summary index fields  &amp;amp;&amp;amp; then delete . for all new events, do at indextime&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 09:10:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442356#M77085</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-08T09:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Combine collect and delete commands in one pipe</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442357#M77086</link>
      <description>&lt;P&gt;Hello again @dreadangel,&lt;/P&gt;

&lt;P&gt;It's not possible to combine both collect &amp;amp; delete in the same search. You should use two different searches to achieve this. Step 1 move, step 2 delete.&lt;/P&gt;

&lt;P&gt;PS: deleting does not really delete the data, more info here : &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Delete"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/Delete&lt;/A&gt; &lt;BR /&gt;
If you want to get rid of the data you should delete the entire index or the relevant buckets. &lt;/P&gt;

&lt;P&gt;If what you're doing is simply for replacing &lt;CODE&gt;status=low&lt;/CODE&gt; by &lt;CODE&gt;status=none&lt;/CODE&gt; you can easily do that via props and transforms as shown here &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Forwarding/Routeandfilterdatad"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/Forwarding/Routeandfilterdatad&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 09:24:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442357#M77086</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-08T09:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Combine collect and delete commands in one pipe</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442358#M77087</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Yeah - I know about &lt;STRONG&gt;delete&lt;/STRONG&gt; command that not actually deletes the data. &lt;BR /&gt;
Unfortunately all this stuff is needed to "edit" the events from index - just imagine that &lt;CODE&gt;index="server_logs"&lt;/CODE&gt;and &lt;CODE&gt;index="old_logs_index"&lt;/CODE&gt;` are the same.&lt;/P&gt;

&lt;P&gt;Anyway thanks for the tip - at last it allowed me not to loose a lot of time investigating.&lt;/P&gt;

&lt;P&gt;P/S This is not a wantie of me - it's bosses' wantie - &lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 09:35:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442358#M77087</guid>
      <dc:creator>dreadangel</dc:creator>
      <dc:date>2019-05-08T09:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Combine collect and delete commands in one pipe</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442359#M77088</link>
      <description>&lt;P&gt;hahah, yeah the bosses get what they want...and yeah if the data is already there you're sort of stuck. In any case let me know if you have any issues with routing the data when you attempt that for new data, happy to assist you !&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 09:40:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442359#M77088</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-08T09:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Combine collect and delete commands in one pipe</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442360#M77089</link>
      <description>&lt;P&gt;the issue I'm facing at the moment is how to execute the sequence of those two commands &lt;STRONG&gt;collect&lt;/STRONG&gt; and &lt;STRONG&gt;delete&lt;/STRONG&gt;, even via UI - any thoughts or suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 11:53:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Combine-collect-and-delete-commands-in-one-pipe/m-p/442360#M77089</guid>
      <dc:creator>dreadangel</dc:creator>
      <dc:date>2019-05-08T11:53:56Z</dc:date>
    </item>
  </channel>
</rss>

