<?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 How to get previous search results as a sub-search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-previous-search-results-as-a-sub-search/m-p/203537#M59123</link>
    <description>&lt;P&gt;Hi all, hope you can help me with this question.&lt;/P&gt;

&lt;P&gt;What I'm trying to do is, given the information Splunk keeps about triggered alerts in index=_internal, create a dashboard with the alerts triggered in a period of time and, using the sid, get the actual results from that alert.&lt;/P&gt;

&lt;P&gt;I'm using the following search to get the information about triggered alerts:&lt;/P&gt;

&lt;P&gt;index="_internal" sourcetype="scheduler" savedsearch_name="Alert*" status=success | table _time app savedsearch_name severity status result_count &lt;STRONG&gt;sid&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;and I want to use the &lt;STRONG&gt;sid&lt;/STRONG&gt; value returned to run a sub-search and get the actual values.&lt;/P&gt;

&lt;P&gt;Something like this, if possible, would be great:&lt;/P&gt;

&lt;P&gt;index="_internal" sourcetype="scheduler" savedsearch_name="Alert*" status=success | table _time app savedsearch_name severity status result_count &lt;STRONG&gt;sid&lt;/STRONG&gt; | append [ loadjob &lt;STRONG&gt;sid&lt;/STRONG&gt; ]&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 08:14:21 GMT</pubDate>
    <dc:creator>cespinoz</dc:creator>
    <dc:date>2020-09-29T08:14:21Z</dc:date>
    <item>
      <title>How to get previous search results as a sub-search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-previous-search-results-as-a-sub-search/m-p/203537#M59123</link>
      <description>&lt;P&gt;Hi all, hope you can help me with this question.&lt;/P&gt;

&lt;P&gt;What I'm trying to do is, given the information Splunk keeps about triggered alerts in index=_internal, create a dashboard with the alerts triggered in a period of time and, using the sid, get the actual results from that alert.&lt;/P&gt;

&lt;P&gt;I'm using the following search to get the information about triggered alerts:&lt;/P&gt;

&lt;P&gt;index="_internal" sourcetype="scheduler" savedsearch_name="Alert*" status=success | table _time app savedsearch_name severity status result_count &lt;STRONG&gt;sid&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;and I want to use the &lt;STRONG&gt;sid&lt;/STRONG&gt; value returned to run a sub-search and get the actual values.&lt;/P&gt;

&lt;P&gt;Something like this, if possible, would be great:&lt;/P&gt;

&lt;P&gt;index="_internal" sourcetype="scheduler" savedsearch_name="Alert*" status=success | table _time app savedsearch_name severity status result_count &lt;STRONG&gt;sid&lt;/STRONG&gt; | append [ loadjob &lt;STRONG&gt;sid&lt;/STRONG&gt; ]&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:14:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-previous-search-results-as-a-sub-search/m-p/203537#M59123</guid>
      <dc:creator>cespinoz</dc:creator>
      <dc:date>2020-09-29T08:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get previous search results as a sub-search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-previous-search-results-as-a-sub-search/m-p/203538#M59124</link>
      <description>&lt;P&gt;The map command might work in this case:&lt;/P&gt;

&lt;P&gt;index="_internal" sourcetype="scheduler" savedsearch_name="Alert*" status=success | table _time app savedsearch_name severity status result_count sid | map [ | loadjob $sid$ ]&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Map" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Map&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You might also find this useful eventually:&lt;BR /&gt;
    map also supports a search id field, provided as $_serial_id$ which will have a number increemented for each run search. In other words, the first run search will have the value 1, and the second 2, and so on.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:14:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-previous-search-results-as-a-sub-search/m-p/203538#M59124</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-09-29T08:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get previous search results as a sub-search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-previous-search-results-as-a-sub-search/m-p/203539#M59125</link>
      <description>&lt;P&gt;Just in case you haven't already checked it out have you seen the built in Triggered Alerts dashboard? &lt;A href="https://your.splunk.instance:8000/en-US/alerts/search"&gt;https://your.splunk.instance:8000/en-US/alerts/search&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For you own custom one  You might be better off having one dashboard that lists all the alerts using your search, then have a  dynamic drilldown that links to &lt;CODE&gt;/app/search/search?q=|loadjob $relevantToken$&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Have a look at the documentation and examples here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/Viz/Dynamicdrilldownindashboardsandforms"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.2/Viz/Dynamicdrilldownindashboardsandforms&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And for the token values you can use for your drill down see this section: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.2/Viz/tokens#Define_tokens_for_dynamic_drilldown"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.2/Viz/tokens#Define_tokens_for_dynamic_drilldown&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Dec 2015 10:32:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-previous-search-results-as-a-sub-search/m-p/203539#M59125</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2015-12-31T10:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get previous search results as a sub-search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-previous-search-results-as-a-sub-search/m-p/203540#M59126</link>
      <description>&lt;P&gt;Both options actually work, thanks for your comments. However, for my particular requirement, I ended up building a dynamic drill down using the SID.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 14:10:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-previous-search-results-as-a-sub-search/m-p/203540#M59126</guid>
      <dc:creator>cespinoz</dc:creator>
      <dc:date>2016-01-05T14:10:37Z</dc:date>
    </item>
  </channel>
</rss>

