<?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 drilldown from a custom module in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-drilldown-from-a-custom-module/m-p/56381#M13805</link>
    <description>&lt;P&gt;I have a custom module that receives search results from an ancestor module and would like to do a drilldown when the user does something, either pass some search terms to a HiddenSearch or dispatch a search itself. How do I go about doing that? It inherits DispatchingModule.&lt;/P&gt;

&lt;P&gt;I've looked at SimpleResultsTable as an example and at the part where it seems to handle a drilldown click it does:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;this.showDescendants(this.DRILLDOWN_VISIBILITY_KEY + "_" + this.moduleId);&lt;BR /&gt;&lt;BR /&gt;
this._selection = this.getSelectionState(evt);&lt;BR /&gt;&lt;BR /&gt;
this.pushContextToChildren();&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;And HiddenSearch does something with contexts as well:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;var context = this.getContext();&lt;BR /&gt;&lt;BR /&gt;
var search  = context.get("search");&lt;BR /&gt;&lt;BR /&gt;
...&lt;BR /&gt;&lt;BR /&gt;
context.set("search", search);&lt;BR /&gt;&lt;BR /&gt;
return context;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I'm not sure what any of the context stuff really means... Any help would be appreciated.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 09:47:48 GMT</pubDate>
    <dc:creator>achung12</dc:creator>
    <dc:date>2020-09-28T09:47:48Z</dc:date>
    <item>
      <title>How to drilldown from a custom module</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-drilldown-from-a-custom-module/m-p/56381#M13805</link>
      <description>&lt;P&gt;I have a custom module that receives search results from an ancestor module and would like to do a drilldown when the user does something, either pass some search terms to a HiddenSearch or dispatch a search itself. How do I go about doing that? It inherits DispatchingModule.&lt;/P&gt;

&lt;P&gt;I've looked at SimpleResultsTable as an example and at the part where it seems to handle a drilldown click it does:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;this.showDescendants(this.DRILLDOWN_VISIBILITY_KEY + "_" + this.moduleId);&lt;BR /&gt;&lt;BR /&gt;
this._selection = this.getSelectionState(evt);&lt;BR /&gt;&lt;BR /&gt;
this.pushContextToChildren();&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;And HiddenSearch does something with contexts as well:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;var context = this.getContext();&lt;BR /&gt;&lt;BR /&gt;
var search  = context.get("search");&lt;BR /&gt;&lt;BR /&gt;
...&lt;BR /&gt;&lt;BR /&gt;
context.set("search", search);&lt;BR /&gt;&lt;BR /&gt;
return context;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I'm not sure what any of the context stuff really means... Any help would be appreciated.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:47:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-drilldown-from-a-custom-module/m-p/56381#M13805</guid>
      <dc:creator>achung12</dc:creator>
      <dc:date>2020-09-28T09:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to drilldown from a custom module</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-drilldown-from-a-custom-module/m-p/56382#M13806</link>
      <description>&lt;P&gt;If you havent already (and quite possibly you have) you should download the 'ui examples' app from splunkbase and read the first few 'intro' views under 'advanced xml'.   &lt;/P&gt;

&lt;P&gt;the code in individual modules doesnt actually dispatch any searches ever.  All it does is 'push' the data it has to downstream modules. &lt;/P&gt;

&lt;P&gt;You should read this answer, but you can skip down to the part that starts with "The trickiest thing to understand":&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/28176/multiple-searches-with-single-parameter-in-advanced-view?page=1#28182"&gt;http://splunk-base.splunk.com/answers/28176/multiple-searches-with-single-parameter-in-advanced-view?page=1#28182&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;OK.  once you've read that,   then calling 'pushContextToChildren()'  will push data to the module's children.    As you now know (from reading that other answer) any searches that need to get kicked off will get kicked off automatically just from you having 'pushed' data downstream and you dont have to worry about them. &lt;/P&gt;

&lt;P&gt;If you want your module to add new 'stuff' for downstream modules,   you do that by implementing getModifiedContext(),  like so &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;getModifiedContext: function() {
    // this is everything that your ancestor modules have given you. 
    var context = this.getContext();

    // the key I want downstream modules to get,  and its value 
    context.set("mySpecialKey",  "someValue")

    return context;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So while calling 'pushContextToChildren' starts the push at the correct time, it is the implementation of getModifiedContext() that determines what will be pushed downstream. &lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2011 05:10:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-drilldown-from-a-custom-module/m-p/56382#M13806</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-08-11T05:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to drilldown from a custom module</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-drilldown-from-a-custom-module/m-p/56383#M13807</link>
      <description>&lt;P&gt;Thanks for the great answer! I tried it and it works perfectly. (I have used UI Examples -- helped me understand intentions and other fancy things)&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2011 13:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-drilldown-from-a-custom-module/m-p/56383#M13807</guid>
      <dc:creator>achung12</dc:creator>
      <dc:date>2011-08-11T13:53:08Z</dc:date>
    </item>
  </channel>
</rss>

