<?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: Running separate searches from a base search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Running-separate-searches-from-a-base-search/m-p/277232#M83608</link>
    <description>&lt;P&gt;Thanks, exactly what I needed!&lt;/P&gt;</description>
    <pubDate>Fri, 16 Dec 2016 13:41:31 GMT</pubDate>
    <dc:creator>szabados</dc:creator>
    <dc:date>2016-12-16T13:41:31Z</dc:date>
    <item>
      <title>Running separate searches from a base search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-separate-searches-from-a-base-search/m-p/277229#M83605</link>
      <description>&lt;P&gt;I have a long search, where in the first part, I'm filtering down lots of data, and doing lookup, eval, etc, let's call this my base search&lt;BR /&gt;
At the end, I want to apply stats to this data set, actually three different functions, and have the results in a table.&lt;BR /&gt;
I'm able to do this, by running the base search 3 times, applying one of the stats function, and appending it to the other results, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| basesearch | stats 1
| append [|basesearch | stats 2]
| append [|basesearch | stats 3]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Obviously, this is a huge overhead of running the same search 3 times in subsearches. I can't use a datamodel, because the parameters of my subsearch are dynamically populated, and it would be almost impossible to create all the summaries for all the possible values.&lt;/P&gt;

&lt;P&gt;Is there any way, to do something like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| basesearch
| stats1
| append [| stats2 appended to the data yielded from the base search at the beginning]
| append [| stats3 appended to the data yielded from the base search at the beginning]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2016 12:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-separate-searches-from-a-base-search/m-p/277229#M83605</guid>
      <dc:creator>szabados</dc:creator>
      <dc:date>2016-12-12T12:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Running separate searches from a base search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-separate-searches-from-a-base-search/m-p/277230#M83606</link>
      <description>&lt;P&gt;Can you add eval/case statements that allow you to do stats2 and stats3 at the same time as you do stats 1? &lt;/P&gt;

&lt;P&gt;There was a great presentation on this at .conf2016 by Nick from Sideview. May be worth a look. &lt;/P&gt;

&lt;P&gt;&lt;A href="https://conf.splunk.com/sessions/2016-sessions.html#search=Let%20Stats%20Sort%20Them%20Out%3A%20Building%20Complex%20Result%20Sets%20That%20Use%20Multiple%20Source%20Types&amp;amp;"&gt;https://conf.splunk.com/sessions/2016-sessions.html#search=Let%20Stats%20Sort%20Them%20Out%3A%20Building%20Complex%20Result%20Sets%20That%20Use%20Multiple%20Source%20Types&amp;amp;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2016 12:54:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-separate-searches-from-a-base-search/m-p/277230#M83606</guid>
      <dc:creator>snoobzilla</dc:creator>
      <dc:date>2016-12-12T12:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Running separate searches from a base search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-separate-searches-from-a-base-search/m-p/277231#M83607</link>
      <description>&lt;P&gt;How about this (works best if you've filtered down number of rows after base search signifacantly)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| basesearch | eval exclude=1
| appendpipe [| stats 1 | eval exclude=0 ]
 | appendpipe [| where exclude=1  | stats 2  | eval exclude=0 ]
| appendpipe [| where exclude=1  | stats 3  | eval exclude=0 ]
| where exclude=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Dec 2016 00:44:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-separate-searches-from-a-base-search/m-p/277231#M83607</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-12-13T00:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Running separate searches from a base search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-separate-searches-from-a-base-search/m-p/277232#M83608</link>
      <description>&lt;P&gt;Thanks, exactly what I needed!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 13:41:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-separate-searches-from-a-base-search/m-p/277232#M83608</guid>
      <dc:creator>szabados</dc:creator>
      <dc:date>2016-12-16T13:41:31Z</dc:date>
    </item>
  </channel>
</rss>

