<?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: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223721#M65870</link>
    <description>&lt;P&gt;If I only have one index and one sourcetype, will this speed things up?  I want to look at all events, and not just within a time window.&lt;/P&gt;

&lt;P&gt;Is there a way to reuse the results of a search?&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jan 2016 19:11:44 GMT</pubDate>
    <dc:creator>CREVITCH</dc:creator>
    <dc:date>2016-01-12T19:11:44Z</dc:date>
    <item>
      <title>Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223717#M65866</link>
      <description>&lt;P&gt;I am executing the following search and it is taking a long time to execute.  Is there a way to save the results of parts of a search so that when I modify the tail end I don't have to run the whole search?  I.e. can I save the results of &lt;CODE&gt;user=* | dedup _ raw&lt;/CODE&gt; and then run those saved results through subsequent searches?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;user=* | dedup _raw | transaction user date_minute date_second
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jan 2016 16:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223717#M65866</guid>
      <dc:creator>CREVITCH</dc:creator>
      <dc:date>2016-01-12T16:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223718#M65867</link>
      <description>&lt;P&gt;You'd probably achieve the same result by using just the stats command, which will be much faster. What is the search requirement here?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 16:42:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223718#M65867</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-01-12T16:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223719#M65868</link>
      <description>&lt;P&gt;Apply filtering as soon as possible and do not use transaction unless you have to.&lt;BR /&gt;
Specify your index name and sourcetype because it will speed things up.&lt;BR /&gt;
Also restrict your search by time using earliest and latest.&lt;/P&gt;

&lt;P&gt;If you post the whole query I can try to be more specific:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=bar user=* 
| fields user date_minute date_second
| stats list(user) by date_minute, date_second
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if that helps&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 16:52:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223719#M65868</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-01-12T16:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223720#M65869</link>
      <description>&lt;P&gt;I am looking to group events by transaction.  Will the stats command do this for me?  &lt;/P&gt;

&lt;P&gt;I have a lot of events.  By doing user=*, I narrow it to login events since they have a user field.  I end up with duplicate events, and I go through dedup.  Finally i am left with events, some of which group together (i.e. password accepted and session opened).  This is why I want to group as transactions: want to preserve individual events, but want to know the number of independent transactions.&lt;/P&gt;

&lt;P&gt;It would be nice to know if there is a way to re-use the results of previous searches.  Is there a way to do this?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 19:10:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223720#M65869</guid>
      <dc:creator>CREVITCH</dc:creator>
      <dc:date>2016-01-12T19:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223721#M65870</link>
      <description>&lt;P&gt;If I only have one index and one sourcetype, will this speed things up?  I want to look at all events, and not just within a time window.&lt;/P&gt;

&lt;P&gt;Is there a way to reuse the results of a search?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 19:11:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223721#M65870</guid>
      <dc:creator>CREVITCH</dc:creator>
      <dc:date>2016-01-12T19:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223722#M65871</link>
      <description>&lt;P&gt;What all field you're interested in? all the fields OR just _raw? &lt;/P&gt;

&lt;P&gt;As &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/113132"&gt;@javiergn&lt;/a&gt; mentioned, restrict your base search by specifying index/sourcetype/source etc. To remove duplicates, group events based on user, date_minute, date_second, try this stats option.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah sourcetype=blah user=* | stats latest(user) as user latest(date_minute) as date_minute latest(date_second) as date_second by _raw | stats list(_raw) as _raw by user date_minute date_second
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to preserve more fields add the to both the stats in similar way.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:24:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223722#M65871</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T08:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223723#M65872</link>
      <description>&lt;P&gt;To save an intermediate result, you could also use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;some search | outputlookup temp.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and from here on start a new search with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup temp.csv | continue search
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If &lt;CODE&gt;some search&lt;/CODE&gt; is a complex (time-consuming) search and you just want to play around with different ways of doing it in &lt;CODE&gt;continue search&lt;/CODE&gt;, then this method will allow you to do so without any hassle. The only thing you may want to look out for is if the intermediate results are too numerous for a .csv file (say, some hundred thousand lines of result).&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 09:26:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223723#M65872</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2016-01-13T09:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223724#M65873</link>
      <description>&lt;P&gt;Even if there's only one index and one sourcetype it's always better to be as specific as possible and apply that filter as early as possible in your query.&lt;/P&gt;

&lt;P&gt;You can reuse the results of a search via different ways but it all depends on what you are trying to achieve, if you give us more details we might be able to help.&lt;/P&gt;

&lt;P&gt;For instance, you can use subsearches, output and inputcsv, collect, etc.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 09:50:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223724#M65873</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-01-13T09:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223725#M65874</link>
      <description>&lt;P&gt;the dedup _raw takes so long I am hoping to store its result to pipe to subesequent searches.  I need to do thsi step because I have many duplicate events for some reason.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 15:23:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223725#M65874</guid>
      <dc:creator>CREVITCH</dc:creator>
      <dc:date>2016-01-13T15:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223726#M65875</link>
      <description>&lt;P&gt;But why do you need to dedup the whole RAW event if you are then only using the following three fields: user date_minute date_second? &lt;/P&gt;

&lt;P&gt;Doesn't the following query work for you?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=bar user=* 
 | fields user date_minute date_second
 | stats list(user) by date_minute, date_second
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or the alternative that uses values instead of list to remove duplicates:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=bar user=* 
 | fields user date_minute date_second
 | stats values(user) by date_minute, date_second
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:25:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223726#M65875</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2020-09-29T08:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whole search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223727#M65876</link>
      <description>&lt;P&gt;Use &lt;CODE&gt;| outputcsv&lt;/CODE&gt; to send to disk and then use &lt;CODE&gt;| inputcsv&lt;/CODE&gt; to pull back in.  You can also use Tableau which has a Splunk connector so you can pull in your raw data and save to disk and then do all of the "stuff" to it from the disk image.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 17:16:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/223727#M65876</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-01-13T17:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to save the results for parts of a search so when I modify the tail end, I don't have to run the whol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/524811#M148053</link>
      <description>&lt;P&gt;Thanks for this interesting suggestion.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried applying this, but I'm getting strange results. Consecutive identical searched is returning different results. My suspicion is that different parts of the search is performed asynchronously, causing the data in an earlier version of temp.csv being read before the new version of temp.csv is written.&lt;/P&gt;&lt;P&gt;Could this be possible?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I'm using "| inputlookup temp.csv" inside a subsearch. Maybe the subsearch is executed&amp;nbsp;&amp;nbsp;asynchronously with the main search?&lt;/P&gt;&lt;P&gt;UPDATE: after looking at the Splunk documentation on subsearches, I read this: "&lt;SPAN&gt;The subsearch is in square brackets and is run first.&amp;nbsp;" This explains the strange behaviour.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 10:04:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-save-the-results-for-parts-of-a-search-so-when/m-p/524811#M148053</guid>
      <dc:creator>BernardEAI</dc:creator>
      <dc:date>2020-10-15T10:04:55Z</dc:date>
    </item>
  </channel>
</rss>

