<?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: Line Timechart drilldown question, how to get value from timechart for permalink panel at the same dashboard? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Line-Timechart-drilldown-question-how-to-get-value-from/m-p/192597#M55399</link>
    <description>&lt;P&gt;I believe you have a couple problems here.  First is that charts have different listeners than tables.  You are using 'click' when you should either be using &lt;CODE&gt;click:chart&lt;/CODE&gt; or &lt;CODE&gt;click:legend&lt;/CODE&gt;.  Also the variables are different.  You should be using &lt;CODE&gt;e.value&lt;/CODE&gt; or &lt;CODE&gt;e.name2&lt;/CODE&gt; respectively.  Check out this example from the SplunkJS documentation... &lt;A href="http://dev.splunk.com/view/webframework-splunkjsstack/SP-CAAAES3"&gt;How to listen for events on views using SplunkJS Stack&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Mar 2014 18:42:19 GMT</pubDate>
    <dc:creator>jklumpp_splunk</dc:creator>
    <dc:date>2014-03-19T18:42:19Z</dc:date>
    <item>
      <title>Line Timechart drilldown question, how to get value from timechart for permalink panel at the same dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Line-Timechart-drilldown-question-how-to-get-value-from/m-p/192596#M55398</link>
      <description>&lt;P&gt;Hi, I am trying to modify "Splunk 6 Dashboard Examples" application -&amp;gt; drilldown elements -&amp;gt; In-Page Drilldown with Perma-Linking. it is gonna be a long explanation.&lt;/P&gt;

&lt;P&gt;my xml code is like below:&lt;BR /&gt;
&lt;CODE&gt;&amp;lt;form&amp;gt;&amp;lt;label&amp;gt;Deneme&amp;lt;/label&amp;gt;&amp;lt;description&amp;gt;Saved Dashboard to Application&amp;lt;/description&amp;gt;&lt;BR /&gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;&lt;BR /&gt;
    &amp;lt;input type="text" token="sourcetype" searchWhenChanged="true" /&amp;gt;&lt;BR /&gt;
  &amp;lt;/fieldset&amp;gt;&lt;BR /&gt;
  &amp;lt;row&amp;gt;&lt;BR /&gt;
    &amp;lt;chart id="master"&amp;gt;&lt;BR /&gt;
      &amp;lt;title&amp;gt;Master&amp;lt;/title&amp;gt;&lt;BR /&gt;
      &amp;lt;searchString&amp;gt;index=generalErrorLog| stats count by sourcetype&amp;lt;/searchString&amp;gt;&lt;BR /&gt;
      &amp;lt;earliestTime&amp;gt;-30d@d&amp;lt;/earliestTime&amp;gt;&lt;BR /&gt;
      &amp;lt;latestTime&amp;gt;now&amp;lt;/latestTime&amp;gt;&lt;BR /&gt;
      &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;&lt;BR /&gt;
      &amp;lt;option name="charting.chart"&amp;gt;line&amp;lt;/option&amp;gt;&amp;lt;row&amp;gt;  &lt;BR /&gt;
  &amp;lt;/row&amp;gt;&lt;BR /&gt;
  &amp;lt;row&amp;gt;&lt;BR /&gt;
     &amp;lt;chart id="detail"&amp;gt;&lt;BR /&gt;
     &amp;lt;title&amp;gt;Detail: $sourcetype$&amp;lt;/title&amp;gt;&lt;BR /&gt;
     &amp;lt;searchTemplate&amp;gt;index=generalErrorLog sourcetype=$sourcetype$ | timechart count&amp;lt;/searchTemplate&amp;gt;&lt;BR /&gt;
     &amp;lt;earliestTime&amp;gt;-30d@d&amp;lt;/earliestTime&amp;gt;&lt;BR /&gt;
     &amp;lt;latestTime&amp;gt;now&amp;lt;/latestTime&amp;gt;&lt;BR /&gt;
     &amp;lt;/chart&amp;gt;&lt;BR /&gt;
  &amp;lt;/row&amp;gt;&lt;BR /&gt;
&amp;lt;/form&amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;And my JavaScript code is as following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require(['jquery','underscore','splunkjs/mvc','util/console','splunkjs/mvc/simplexml/ready!'], function($, _, mvc, console){    
// Get a reference to the dashboard panels
var masterView = mvc.Components.get('master');
var detailView .........

if(!submittedTokens.has('source')) {
    // if there's no value for the $sourcetype$ token yet, hide the dashboard panel of the detail view
    detailView.$el.parents('.dashboard-panel').hide();
}'

submittedTokens.on('change:sourcetype', function(){
    alert("submitted tokens ON");

    // When the token changes...
    if(!submittedTokens.get('sourcetype')) {
        // ... hide the panel if the token is not defined
        //alert("no token");
        detailView.$el.parents('.dashboard-panel').hide();
    } else {
        alert("got a token");
        // ... show the panel if the token has a value
        detailView.$el.parents('.dashboard-panel').show();
    }
});
masterView.on('click', function(e) {
    alert("click function is ON");
    e.preventDefault();
    //**I suspect the function below.**
    var newValue = e.data['row.sourcetype'];
    alert("Sourcetype: "+ newValue);
    detailView.$el.parents('.dashboard-panel').show();
    // Submit the value for the source field
    unsubmittedTokens.set('form.sourcetype', newValue);
    submittedTokens.set(unsubmittedTokens.toJSON());
    urlTokens.saveOnlyWithPrefix('form\\.', unsubmittedTokens.toJSON(), {
        replaceState: false
    });
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above code works &lt;/P&gt;

&lt;P&gt;As you can see in Js code, that I m checking value passes between panels with alert() function. When same code above works with "stats" responding to the Js Function: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var newValue = e.data['row.sourcetype'];
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it doesn't work with timechart. "row.sourcetype" returns "UNDEFINED" when I click on line or sourcetype values on the right side of the panel. &lt;BR /&gt;
I tried couple combinations like column.sourcetype &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; so far it didn't work out.&lt;/P&gt;

&lt;P&gt;So that wise guy with the information, I need your help again. Thank you all for your time.&lt;BR /&gt;
Edit1: Grammar&lt;BR /&gt;
Edit2: Snapshot to visualize - I need the sourcetype value @ detail panel&lt;BR /&gt;
&lt;IMG src="http://answers.splunk.com//storage/questionSnap.gif" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2014 16:39:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Line-Timechart-drilldown-question-how-to-get-value-from/m-p/192596#M55398</guid>
      <dc:creator>axl88</dc:creator>
      <dc:date>2014-03-18T16:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Line Timechart drilldown question, how to get value from timechart for permalink panel at the same dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Line-Timechart-drilldown-question-how-to-get-value-from/m-p/192597#M55399</link>
      <description>&lt;P&gt;I believe you have a couple problems here.  First is that charts have different listeners than tables.  You are using 'click' when you should either be using &lt;CODE&gt;click:chart&lt;/CODE&gt; or &lt;CODE&gt;click:legend&lt;/CODE&gt;.  Also the variables are different.  You should be using &lt;CODE&gt;e.value&lt;/CODE&gt; or &lt;CODE&gt;e.name2&lt;/CODE&gt; respectively.  Check out this example from the SplunkJS documentation... &lt;A href="http://dev.splunk.com/view/webframework-splunkjsstack/SP-CAAAES3"&gt;How to listen for events on views using SplunkJS Stack&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2014 18:42:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Line-Timechart-drilldown-question-how-to-get-value-from/m-p/192597#M55399</guid>
      <dc:creator>jklumpp_splunk</dc:creator>
      <dc:date>2014-03-19T18:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Line Timechart drilldown question, how to get value from timechart for permalink panel at the same dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Line-Timechart-drilldown-question-how-to-get-value-from/m-p/192598#M55400</link>
      <description>&lt;P&gt;Sorry for late response, your advice is correct for my question. thnx&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2014 13:52:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Line-Timechart-drilldown-question-how-to-get-value-from/m-p/192598#M55400</guid>
      <dc:creator>axl88</dc:creator>
      <dc:date>2014-05-21T13:52:22Z</dc:date>
    </item>
  </channel>
</rss>

