<?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: Can I reuse subsearch results for two panels in a form? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68674#M17245</link>
    <description>&lt;P&gt;A bit of advise would be useful here - I very often see problems answered by everyone being told to use the sideview utils. As I want to provide reporting that can be used against my product by any Splunk user, I had assumed that I should stick to the built-in Splunk function set, just as when developing UNIX apps I would try to use only the available OS interfaces and not expect end users to have to install other 3rd party packages to get things to work.&lt;/P&gt;

&lt;P&gt;What do others do in these circumstances? Do you bundle Sideview utils with your apps? Or tell the end user they must install it first? What if the user has some reason to not want to install sideview? etc...&lt;/P&gt;</description>
    <pubDate>Fri, 19 Oct 2012 07:23:43 GMT</pubDate>
    <dc:creator>steveta_uk</dc:creator>
    <dc:date>2012-10-19T07:23:43Z</dc:date>
    <item>
      <title>Can I reuse subsearch results for two panels in a form?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68666#M17237</link>
      <description>&lt;P&gt;I am trying to develop a view that allows the user to select two time periods, then determine what changes have been made to a particular field between these two periods. For example, to determine what hosts were in use last week and not this week, and vice versa.&lt;/P&gt;

&lt;P&gt;The search is easy enough, basically the two result sets are given by these search strings:&lt;/P&gt;

&lt;P&gt;sourcetype="syslog" earliest=-14d latest=-7d NOT [search sourcetype="syslog" earliest=-7d latest=-0d | fields host | dedup host] | fields host | fields - _* | dedup host&lt;/P&gt;

&lt;P&gt;sourcetype="syslog" earliest=-7d latest=-0d NOT [search sourcetype="syslog" earliest=-14d latest=-7d | fields host | dedup host] | fields host | fields - _* | dedup host&lt;/P&gt;

&lt;P&gt;Is there a way to reduce this from 4 searches to 2, by somehow saving the subsearch and outer search results, and then comparing them as A NOT B and B NOT A ?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2012 16:24:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68666#M17237</guid>
      <dc:creator>steveta_uk</dc:creator>
      <dc:date>2012-09-24T16:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse subsearch results for two panels in a form?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68667#M17238</link>
      <description>&lt;P&gt;Yes,  I would create a base search with some post process searches. Hopfully this get you started.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Developer/PostProcess"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Developer/PostProcess&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2012 17:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68667#M17238</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2012-09-24T17:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse subsearch results for two panels in a form?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68668#M17239</link>
      <description>&lt;P&gt;Not sure this helps - I have two different base searches, and the same two searches as subsearches but swapped around, and what I'm trying to do is only run them once each but process the results in a different sequence.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2012 17:25:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68668#M17239</guid>
      <dc:creator>steveta_uk</dc:creator>
      <dc:date>2012-09-24T17:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse subsearch results for two panels in a form?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68669#M17240</link>
      <description>&lt;P&gt;I haven't tested this, but your base search might look something like.  I might have my comparision operators incorrect. I also hope I understand what your tying to accomplish.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
sourcetype="syslog" earliest=-14d latest=-0d | eval preweek = if(_time &amp;gt;= relative_time(now(), "-14d@d"), host, null())|eval preweek = if(_time &amp;lt;= relative_time(now(), "-7d@d"), host, null())|eval curweek = if(_time &amp;gt;= relative_time(now(), "-7d@d"), host, null())|eval curweek = if(_time &amp;lt;= relative_time(now(), "0d@d"), host, null())| dedup curweek, preweek  | field curweek, preweek&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
Cheers,&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:30:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68669#M17240</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2020-09-28T12:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse subsearch results for two panels in a form?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68670#M17241</link>
      <description>&lt;P&gt;you can write the results to a csv file after the first run and then read the results for the second.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 03:29:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68670#M17241</guid>
      <dc:creator>carasso</dc:creator>
      <dc:date>2012-10-19T03:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse subsearch results for two panels in a form?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68671#M17242</link>
      <description>&lt;P&gt;Carasso, yes this was the solution I have adopted, but it has problems in a couple of areas. Firstly the pager in the results doesn't know the correct number of hits, so for example shows pages 1-10 where only pages 1-3 have any results in them, this is because the pager seemd to be based on the count of hits in the base search, not on the postprocess. Secondly, the progress bar is all wrong - I think possibly for the same reason.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 06:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68671#M17242</guid>
      <dc:creator>steveta_uk</dc:creator>
      <dc:date>2012-10-19T06:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse subsearch results for two panels in a form?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68672#M17243</link>
      <description>&lt;P&gt;Carasso, yes this was the solution I have adopted, but it has problems in a couple of areas. Firstly the pager in the results doesn't know the correct number of hits, so for example shows pages 1-10 where only pages 1-3 have any results in them, this is because the pager seemd to be based on the count of hits in the base search, not on the postprocess. Secondly, the progress bar is all wrong - I think possibly for the same reason.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 06:33:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68672#M17243</guid>
      <dc:creator>steveta_uk</dc:creator>
      <dc:date>2012-10-19T06:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse subsearch results for two panels in a form?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68673#M17244</link>
      <description>&lt;P&gt;The "PostProcess" module in Sideview Utils addresses precisely this issue.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 06:55:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68673#M17244</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-19T06:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I reuse subsearch results for two panels in a form?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68674#M17245</link>
      <description>&lt;P&gt;A bit of advise would be useful here - I very often see problems answered by everyone being told to use the sideview utils. As I want to provide reporting that can be used against my product by any Splunk user, I had assumed that I should stick to the built-in Splunk function set, just as when developing UNIX apps I would try to use only the available OS interfaces and not expect end users to have to install other 3rd party packages to get things to work.&lt;/P&gt;

&lt;P&gt;What do others do in these circumstances? Do you bundle Sideview utils with your apps? Or tell the end user they must install it first? What if the user has some reason to not want to install sideview? etc...&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 07:23:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-reuse-subsearch-results-for-two-panels-in-a-form/m-p/68674#M17245</guid>
      <dc:creator>steveta_uk</dc:creator>
      <dc:date>2012-10-19T07:23:43Z</dc:date>
    </item>
  </channel>
</rss>

