<?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 do you add a search bar without Advanced XML? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252869#M15750</link>
    <description>&lt;P&gt;With advanced xml, it was easy to add a search bar by just adding a module:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;view&amp;gt;
  &amp;lt;label&amp;gt;Basic Search View&amp;lt;/label&amp;gt;

  &amp;lt;!-- top nav chrome --&amp;gt;
  &amp;lt;module name="AccountBar" layoutPanel="appHeader"/&amp;gt;
  &amp;lt;module name="AppBar" layoutPanel="navigationHeader"/&amp;gt;

  ### this bit ############
  &amp;lt;!-- This module renders the search box --&amp;gt;
  &amp;lt;module name="SearchBar" layoutPanel="mainSearchControls"&amp;gt;
  &amp;lt;/module&amp;gt;&amp;lt;!-- close SearchBar module --&amp;gt;
  #########################
&amp;lt;/view&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So now that Advanced XML has gone byebye, how do you add a search bar?  We are not interested in adding a "text field" or pre-defining the search, or re-creating the search bar from js elements, if possible.   Does anyone know how to do this?&lt;/P&gt;</description>
    <pubDate>Fri, 02 Oct 2015 17:22:15 GMT</pubDate>
    <dc:creator>proletariat99</dc:creator>
    <dc:date>2015-10-02T17:22:15Z</dc:date>
    <item>
      <title>How do you add a search bar without Advanced XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252869#M15750</link>
      <description>&lt;P&gt;With advanced xml, it was easy to add a search bar by just adding a module:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;view&amp;gt;
  &amp;lt;label&amp;gt;Basic Search View&amp;lt;/label&amp;gt;

  &amp;lt;!-- top nav chrome --&amp;gt;
  &amp;lt;module name="AccountBar" layoutPanel="appHeader"/&amp;gt;
  &amp;lt;module name="AppBar" layoutPanel="navigationHeader"/&amp;gt;

  ### this bit ############
  &amp;lt;!-- This module renders the search box --&amp;gt;
  &amp;lt;module name="SearchBar" layoutPanel="mainSearchControls"&amp;gt;
  &amp;lt;/module&amp;gt;&amp;lt;!-- close SearchBar module --&amp;gt;
  #########################
&amp;lt;/view&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So now that Advanced XML has gone byebye, how do you add a search bar?  We are not interested in adding a "text field" or pre-defining the search, or re-creating the search bar from js elements, if possible.   Does anyone know how to do this?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 17:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252869#M15750</guid>
      <dc:creator>proletariat99</dc:creator>
      <dc:date>2015-10-02T17:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do you add a search bar without Advanced XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252870#M15751</link>
      <description>&lt;P&gt;Unfortunately this is not possible with simple xml. See more details here&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/10746/add-a-search-bar-in-simple-dashboard.html"&gt;http://answers.splunk.com/answers/10746/add-a-search-bar-in-simple-dashboard.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 18:15:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252870#M15751</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-02T18:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do you add a search bar without Advanced XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252871#M15752</link>
      <description>&lt;P&gt;Thanks.  I'm not interested in using simpleXML.  I should've been more explicit in my question.  So is there a JavaScript or python object that you can instantiate to insert a toolbar?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 21:35:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252871#M15752</guid>
      <dc:creator>proletariat99</dc:creator>
      <dc:date>2015-10-02T21:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do you add a search bar without Advanced XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252872#M15753</link>
      <description>&lt;P&gt;You can add search bar using SearchBarView either using django bindings (not recomended since it's marked as deprecated - &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.0/ReleaseNotes/Deprecatedfeatures"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.0/ReleaseNotes/Deprecatedfeatures&lt;/A&gt;) or javascript.&lt;/P&gt;

&lt;P&gt;Below is the sample with javascript from SearchBarView  documentation &lt;A href="http://docs.splunk.com/DocumentationStatic/WebFramework/1.0/compref_searchbar.html"&gt;http://docs.splunk.com/DocumentationStatic/WebFramework/1.0/compref_searchbar.html&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;script&amp;gt;
    var deps = [
        "splunkjs/ready!",
        "splunkjs/mvc/searchmanager",
        "splunkjs/mvc/searchbarview"
    ];
    require(deps, function(mvc) {
        var SearchManager = require("splunkjs/mvc/searchmanager");
        var SearchBarView = require("splunkjs/mvc/searchbarview");

        // Create the search manager
        var mysearch = new SearchManager({
            id: "example-search",
            status_buckets: 300,
            required_field_list: "*",
            preview: true,
            cache: true,
            autostart: false, // Prevent the search from running automatically
            search: "index=_internal | head 500" 
        });

        // Create the searchbar
        var mysearchbar = new SearchBarView({
            id: "example-searchbar",
            managerid: "example-search",
            el: $("#mysearchbarview")
        }).render();

        // Listen for changes to the search query portion of the searchbar
        mysearchbar.on("change", function() {
            // Update the search query
            mysearch.set("search", mysearchbar.val());

            // Run the search (because autostart=false)
            mysearch.startSearch();
        });

        // Listen for changes to the built-in timerange portion of the searchbar
        mysearchbar.timerange.on("change", function() {
            // Update the time range of the search
            mysearch.search.set(mysearchbar.timerange.val()); 

            // Run the search (because autostart=false)
            mysearch.startSearch();
        })

&amp;lt;/script&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Oct 2015 10:36:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252872#M15753</guid>
      <dc:creator>piUek</dc:creator>
      <dc:date>2015-10-05T10:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do you add a search bar without Advanced XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252873#M15754</link>
      <description>&lt;P&gt;The Splunk Web Framework Toolkit app has the code and a working example for you to reference. Download and install the app from splunkbase.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://splunkbase.splunk.com/app/1613/"&gt;Splunk Web Framework Toolkit app&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Navigate to ‘Splunk Components’ -&amp;gt; ‘Search manager controls’. The first example shows code and a working search bar with timerange picker. The app also has a ton of other examples to learn from. &lt;/P&gt;

&lt;P&gt;Here's the code from the app:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var SearchBarView = require("splunkjs/mvc/searchbarview");
new SearchBarView({
    id: "example-search-bar",
    managerid: "example-bar-search",
    el: $("#divToHangOn")
}).render();

var TableView = require("splunkjs/mvc/tableview");
new TableView({
    id: "example-table",
    managerid: "example-bar-search",
    pageSize: "5",
    el: $("#divToHangOn2") // seperate div
}).render();

var SearchManager = require("splunkjs/mvc/searchmanager");
new SearchManager({
    id: "example-bar-search",
    search: "index=_internal | head 100 | timechart count by sourcetype span=100s",
});    

// Hooking up events (both JavaScript and Django)
var manager = splunkjs.mvc.Components.getInstance("example-bar-search");
var searchbar = splunkjs.mvc.Components.getInstance("example-search-bar");
var timerange = searchbar.timerange;

searchbar.on("change", function() {
    manager.set("search", searchbar.val()); 
});

timerange.on("change", function() {
    manager.search.set(timerange.val()); 
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Oct 2015 17:49:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252873#M15754</guid>
      <dc:creator>shaskell_splunk</dc:creator>
      <dc:date>2015-10-08T17:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do you add a search bar without Advanced XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252874#M15755</link>
      <description>&lt;P&gt;Thanks!  That's really helpful.  Definitely helps to have an example.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2015 14:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-add-a-search-bar-without-Advanced-XML/m-p/252874#M15755</guid>
      <dc:creator>proletariat99</dc:creator>
      <dc:date>2015-10-09T14:42:34Z</dc:date>
    </item>
  </channel>
</rss>

