<?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: How Do I Update Url With Search Tokens in HTML Dashboard in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376846#M24662</link>
    <description>&lt;P&gt;Do you have submit button also?&lt;/P&gt;</description>
    <pubDate>Thu, 27 Dec 2018 09:04:38 GMT</pubDate>
    <dc:creator>p_gurav</dc:creator>
    <dc:date>2018-12-27T09:04:38Z</dc:date>
    <item>
      <title>How Do I Update Url With Search Tokens in HTML Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376845#M24661</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;

&lt;P&gt;I have an HTML Dashboard. On it I have a SearchManager, a TimeRangeView, and a number of DropdownViews and TextInputViews that modify MVC Tokens that are used in the search query. The search updates properly when any of these are changed. If I manually add the token names to the dashboard url, I can load a page where those tokens are pre-populated.&lt;/P&gt;

&lt;P&gt;However when any token values are changed when the user interacts with the TimeRangeView/DropdownViews/TextInputViews and the search runs, the url remains the same as when I loaded the page. What is the proper way to update the URL when the search executes so that a user can copy the url and perform that search at a later time with those token values?&lt;/P&gt;

&lt;P&gt;Thank you very much for any help you can provide.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 00:59:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376845#M24661</guid>
      <dc:creator>SplunkPersonal</dc:creator>
      <dc:date>2018-12-18T00:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Update Url With Search Tokens in HTML Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376846#M24662</link>
      <description>&lt;P&gt;Do you have submit button also?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 09:04:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376846#M24662</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-12-27T09:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Update Url With Search Tokens in HTML Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376847#M24663</link>
      <description>&lt;P&gt;Thanks for the reply. I do not have a submit button on the dashboard. I have the SearchManager set to update the search automatically when the tokens change.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2018 00:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376847#M24663</guid>
      <dc:creator>SplunkPersonal</dc:creator>
      <dc:date>2018-12-28T00:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Update Url With Search Tokens in HTML Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376848#M24664</link>
      <description>&lt;P&gt;Since I did not receive a reply, I'm assuming there is not a built-in way to handle this via Splunk. I ended up implementing this capability myself by building the new url with my token values (using encodeURIComponent for encoding) and then using history.pushState/history.replaceState to update the actual url without leaving the page. Splunk already parses those tokens out of the url when a user returns to that url later.&lt;/P&gt;

&lt;P&gt;Ideally I'd love to see this capability directly integrated into the Splunk token model (allowing user to specify which tokens they want to update in the url and whether they want pushState-type or replaceState-type browser history support).&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 17:29:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376848#M24664</guid>
      <dc:creator>SplunkPersonal</dc:creator>
      <dc:date>2019-01-23T17:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Update Url With Search Tokens in HTML Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376849#M24665</link>
      <description>&lt;P&gt;I'm looking for a solution to the same issue. I actually do have a Submit button, which when pressed does update the URL. However, I'd like for users to not have to go through this extra step. Do you mind sharing your code for your solution?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 05:49:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376849#M24665</guid>
      <dc:creator>phoenix_down</dc:creator>
      <dc:date>2019-03-01T05:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Update Url With Search Tokens in HTML Dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376850#M24666</link>
      <description>&lt;P&gt;Are you updating your tokens via JavaScript. Because normally splunk update the URL If you use internal splunk inputs..&lt;BR /&gt;
If you are using JavaScript to Update token.. Please update URL token (Submitted Tokens) as well..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var defaultTokens = mvc.Components.get("default"); 
var submittedTokens = mvc.Components.get("submitted"); 
var tokens = {
    get: function(tokenName) {
        return defaultTokens.get(tokenName);
    },

    set: function(tokenName, tokenValue) {
        defaultTokens.set(tokenName, tokenValue);
        submittedTokens.set(tokenName, tokenValue);
    }, 
    on: function(eventName, callback) { 
        defaultTokens.on(eventName, callback); 
    }
};
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And do &lt;CODE&gt;token.get()/set()&lt;/CODE&gt;&lt;BR /&gt;
Check "Working with tokens in a custom component" &lt;A href="http://dev.splunk.com/view/dev-guide/SP-CAAAE25"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 06:41:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-Do-I-Update-Url-With-Search-Tokens-in-HTML-Dashboard/m-p/376850#M24666</guid>
      <dc:creator>paramagurukarth</dc:creator>
      <dc:date>2019-03-01T06:41:23Z</dc:date>
    </item>
  </channel>
</rss>

