<?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 splunk framework form dropdown problem in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/splunk-framework-form-dropdown-problem/m-p/138196#M8312</link>
    <description>&lt;P&gt;Hi all, &lt;BR /&gt;
I'm trying to make a simple dropdown in splunk framework that visualize all my source.&lt;BR /&gt;
What I'm suppose to insert in the block content, to visualize the dropdown?&lt;BR /&gt;
 And I would like use the results of the search instead of 1, 2, 3, How I can do this? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{% extends "splunkdj:base_with_app_bar.html" %}
{% load splunkmvc %}

{% block content %}


{% endblock content%}

{% block js %}
    &amp;lt;script&amp;gt;
    var deps = [
            "splunkjs/ready!",
            "splunkjs/mvc/searchmanager",
            "splunkjs/mvc/dropdownview"
        ];

        require(deps, function(mvc) {
            var SearchManager = require("splunkjs/mvc/searchmanager");
        new SearchManager({
                id: "mysearch-log",
                search: "index=waratek | stats dc(source) by source | eval rule=source | fields rule"
            });

    var DropdownView = require("splunkjs/mvc/dropdownview");
        new DropdownView({
            id: "drop-list",
            default: "One",
            el: $("#divToHangOn")
        }).render();


    var choices = [{label: " One", value: "One"},
        {label:" Two", value: "Two"},
        {label:" Three", value: "Three"}];

    //I would like use the results of the search instead of this 3 values
    //like=label:" Two", value: rule[2]
    //like=label:" Three", value: rule[3]


    splunkjs.mvc.Components.getInstance("drop-list").settings.set("choices", choices);

        var sbg = splunkjs.mvc.Components.getInstance("drop-list");
        var sbResult = document.getElementById("example-dropdown-result");
        sbg.on("change", function(){
            sbResult.innerHTML = sbg.val();
        });

//write the drop-list click in a in a file

        });
    &amp;lt;/script&amp;gt;
{% endblock js %}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you &lt;/P&gt;</description>
    <pubDate>Mon, 16 Feb 2015 12:20:06 GMT</pubDate>
    <dc:creator>Federica_92</dc:creator>
    <dc:date>2015-02-16T12:20:06Z</dc:date>
    <item>
      <title>splunk framework form dropdown problem</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/splunk-framework-form-dropdown-problem/m-p/138196#M8312</link>
      <description>&lt;P&gt;Hi all, &lt;BR /&gt;
I'm trying to make a simple dropdown in splunk framework that visualize all my source.&lt;BR /&gt;
What I'm suppose to insert in the block content, to visualize the dropdown?&lt;BR /&gt;
 And I would like use the results of the search instead of 1, 2, 3, How I can do this? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{% extends "splunkdj:base_with_app_bar.html" %}
{% load splunkmvc %}

{% block content %}


{% endblock content%}

{% block js %}
    &amp;lt;script&amp;gt;
    var deps = [
            "splunkjs/ready!",
            "splunkjs/mvc/searchmanager",
            "splunkjs/mvc/dropdownview"
        ];

        require(deps, function(mvc) {
            var SearchManager = require("splunkjs/mvc/searchmanager");
        new SearchManager({
                id: "mysearch-log",
                search: "index=waratek | stats dc(source) by source | eval rule=source | fields rule"
            });

    var DropdownView = require("splunkjs/mvc/dropdownview");
        new DropdownView({
            id: "drop-list",
            default: "One",
            el: $("#divToHangOn")
        }).render();


    var choices = [{label: " One", value: "One"},
        {label:" Two", value: "Two"},
        {label:" Three", value: "Three"}];

    //I would like use the results of the search instead of this 3 values
    //like=label:" Two", value: rule[2]
    //like=label:" Three", value: rule[3]


    splunkjs.mvc.Components.getInstance("drop-list").settings.set("choices", choices);

        var sbg = splunkjs.mvc.Components.getInstance("drop-list");
        var sbResult = document.getElementById("example-dropdown-result");
        sbg.on("change", function(){
            sbResult.innerHTML = sbg.val();
        });

//write the drop-list click in a in a file

        });
    &amp;lt;/script&amp;gt;
{% endblock js %}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you &lt;/P&gt;</description>
      <pubDate>Mon, 16 Feb 2015 12:20:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/splunk-framework-form-dropdown-problem/m-p/138196#M8312</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-16T12:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: splunk framework form dropdown problem</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/splunk-framework-form-dropdown-problem/m-p/138197#M8313</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Please take a look at this

 &lt;A href="http://dev.splunk.com/view/SP-CAAAEN4" target="test_blank"&gt;http://dev.splunk.com/view/SP-CAAAEN4&lt;/A&gt;  (On the right hand side, you have step by step instructions)

{block managers} will hold the search and {block content} will contain the type of visualization you want for the searches.

Also, are you looking for total # of sources in a index? or count of events per source ?

index=waratek|stats count as Events by source? Hope this helps

Thanks,
Raghav
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Feb 2015 13:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/splunk-framework-form-dropdown-problem/m-p/138197#M8313</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2015-02-16T13:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: splunk framework form dropdown problem</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/splunk-framework-form-dropdown-problem/m-p/138198#M8314</link>
      <description>&lt;P&gt;Thank you for your reply, I would like create a dropdown menu to select " rul1 " or "rul2" or "rul3" that are all my source if I search index=waratek.&lt;BR /&gt;
So yeah: index=waratek | stats dc(source) (And in splunk works perfectly, give me the correct results).&lt;/P&gt;

&lt;P&gt;The problem is that If I create this query and next I try to make something like this:&lt;BR /&gt;
{block content..&lt;BR /&gt;
{% dropdown id="list" managerid="list-search" %}&lt;/P&gt;

&lt;P&gt;and in search, or in the javascript code I add the query:&lt;BR /&gt;
index=waratek | stats dc(source) by source | fields source&lt;/P&gt;

&lt;P&gt;I'll obtain an error like"Duplicate labels causing conflict splunk"&lt;/P&gt;

&lt;P&gt;So I'm trying with "var choices = [{label: " One", value: "One"},&lt;BR /&gt;
{label:" Two", value: "Two"},&lt;BR /&gt;
{label:" Three", value: "Three"}];"&lt;BR /&gt;
But I would like use instead of these values (one, two..), the results of my previously query (rul1, rul2..)&lt;BR /&gt;
And next take this value to create another query.&lt;/P&gt;

&lt;P&gt;Please, how I can make this?&lt;BR /&gt;
Thank you a mil&lt;/P&gt;</description>
      <pubDate>Mon, 16 Feb 2015 13:42:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/splunk-framework-form-dropdown-problem/m-p/138198#M8314</guid>
      <dc:creator>Federica_92</dc:creator>
      <dc:date>2015-02-16T13:42:37Z</dc:date>
    </item>
  </channel>
</rss>

