<?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: Embed token values in html string in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559223#M38876</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you very much for your answer! I am pretty sure that your solution would work, I used JS several times with lines similar to yours in other dashboards without any issues, but this time I actually wanted to try without involving JS code.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My request is due to the fact that JS code is not very suitable when operating on Splunk Cloud because of the difficulties to debug and upload the separate .js file. Do you think it's possible to achieve the same outcome just using XML and HTML?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;Enrico&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jul 2021 06:43:08 GMT</pubDate>
    <dc:creator>Enrico</dc:creator>
    <dc:date>2021-07-13T06:43:08Z</dc:date>
    <item>
      <title>Embed token values in html string</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559109#M38858</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I need to insert inside my dashboard a button that makes a call to a URL, embedding in the string the values of some tokens that are generated by the inputs of the dashboard.&lt;/P&gt;&lt;P&gt;In order to do this I inserted in the XML code the following HTML lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;row&amp;gt;
  &amp;lt;panel&amp;gt;
    &amp;lt;html&amp;gt;
      &amp;lt;form action="heregoestheURL" target="_blank"&amp;gt;
        &amp;lt;input type="submit" value="Esporta"/&amp;gt;
      &amp;lt;/form&amp;gt;
    &amp;lt;/html&amp;gt;
  &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code works fine, the HTML button is correctly visualised in the dashboard and it is opening correctly the new window in the browser when pushed, but I cannot find a way to dynamically pass to the URL the values of the tokens. Does anyone have any idea on how I could implement this?&lt;/P&gt;&lt;P&gt;Any help is really appreciated. Thanks!&lt;/P&gt;&lt;P&gt;Enrico&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 15:16:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559109#M38858</guid>
      <dc:creator>Enrico</dc:creator>
      <dc:date>2021-07-12T15:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Embed token values in html string</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559127#M38860</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233202"&gt;@Enrico&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure Splunk allow this but you can achieve this by using JS.&amp;nbsp;Can you please try this?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XML&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form script="submit_form.js"&amp;gt;
  &amp;lt;label&amp;gt;Submit Form&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;input type="button" id="button" value="Esporta"/&amp;gt;
    &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;submit_form.js&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc) {
    var utils = require("splunkjs/mvc/utils");
    $(document).ready(function() {
        $("#button").click(function() {
            utils.redirect('heregoestheURL?a=b&amp;amp;c=d', "_blank");
        });
    });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 16:19:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559127#M38860</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-12T16:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Embed token values in html string</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559223#M38876</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you very much for your answer! I am pretty sure that your solution would work, I used JS several times with lines similar to yours in other dashboards without any issues, but this time I actually wanted to try without involving JS code.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My request is due to the fact that JS code is not very suitable when operating on Splunk Cloud because of the difficulties to debug and upload the separate .js file. Do you think it's possible to achieve the same outcome just using XML and HTML?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;Enrico&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 06:43:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559223#M38876</guid>
      <dc:creator>Enrico</dc:creator>
      <dc:date>2021-07-13T06:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Embed token values in html string</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559229#M38877</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233202"&gt;@Enrico&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Submit Form&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;a class="btn" href="heregoestheURL?a=b&amp;amp;amp;c=d" target="_blank" &amp;gt;Submit&amp;lt;/a&amp;gt;  
    &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 07:51:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559229#M38877</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-13T07:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Embed token values in html string</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559233#M38878</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you once again. I tried your solution but unfortunately it is not giving the expected results: the new window is opened but the parameters are not substituted in the URL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Enrico&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 08:11:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559233#M38878</guid>
      <dc:creator>Enrico</dc:creator>
      <dc:date>2021-07-13T08:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Embed token values in html string</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559234#M38879</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233202"&gt;@Enrico&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please share your sample XML?&lt;/P&gt;&lt;P&gt;KV&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 08:17:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559234#M38879</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-13T08:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Embed token values in html string</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559236#M38880</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Sure, here it goes:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;row&amp;gt;
  &amp;lt;panel&amp;gt;
     &amp;lt;html&amp;gt;
       &amp;lt;a class="btn" href="https://*******************/Export/Index?sezione=$sezioneValue$&amp;amp;amp;earliestTime=$timeValueEarliest$&amp;amp;amp;latestTime=$timeValueLatest$&amp;amp;amp;startTime=$tokenEarliestTime$&amp;amp;amp;endTime=$tokenLatestTime$" target="_blank" &amp;gt;Export&amp;lt;/a&amp;gt;  
      &amp;lt;/html&amp;gt;
   &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;This is inserted inside a normal dashboard composed of several panels. I also tried to remove both "$" and also to leave only the first one, but nothing changed. The URL is always considered as a static string and the variables are not substituted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Enrico&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 08:53:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559236#M38880</guid>
      <dc:creator>Enrico</dc:creator>
      <dc:date>2021-07-13T08:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Embed token values in html string</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559238#M38881</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233202"&gt;@Enrico&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your code works for me. &amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt; Check this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Submit Form&amp;lt;/label&amp;gt;
  &amp;lt;init&amp;gt;
    &amp;lt;set token="sezioneValue"&amp;gt;A&amp;lt;/set&amp;gt;
    &amp;lt;set token="timeValueEarliest"&amp;gt;10&amp;lt;/set&amp;gt;
    &amp;lt;set token="timeValueLatest"&amp;gt;20&amp;lt;/set&amp;gt;
    &amp;lt;set token="tokenEarliestTime"&amp;gt;30&amp;lt;/set&amp;gt;
    &amp;lt;set token="tokenLatestTime"&amp;gt;40&amp;lt;/set&amp;gt;
  &amp;lt;/init&amp;gt;
  &amp;lt;row&amp;gt;
  &amp;lt;panel&amp;gt;
     &amp;lt;html&amp;gt;
       &amp;lt;a class="btn" href="https://*******************/Export/Index?sezione=$sezioneValue$&amp;amp;amp;earliestTime=$timeValueEarliest$&amp;amp;amp;latestTime=$timeValueLatest$&amp;amp;amp;startTime=$tokenEarliestTime$&amp;amp;amp;endTime=$tokenLatestTime$" target="_blank" &amp;gt;Export&amp;lt;/a&amp;gt;  
      &amp;lt;/html&amp;gt;
   &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-07-13 at 2.37.07 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15060i9DA883D6990015B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-07-13 at 2.37.07 PM.png" alt="Screenshot 2021-07-13 at 2.37.07 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 09:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559238#M38881</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-13T09:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Embed token values in html string</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559240#M38882</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I added the initialisation and now it is working for me too, thanks a lot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day!&lt;/P&gt;&lt;P&gt;Enrico&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 09:20:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/559240#M38882</guid>
      <dc:creator>Enrico</dc:creator>
      <dc:date>2021-07-13T09:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Embed token values in html string</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/701044#M57475</link>
      <description>&lt;P&gt;I tried the exact same thing just with my url.&amp;nbsp; It did not pass any tokens.&amp;nbsp; Permissions have been double and tripe checked.&amp;nbsp; IS there a limit to how many tokens can be passed.&amp;nbsp; I am trying to pass the current dashboard a user may be on so they can share the link with all the tokens(filters) applied.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 18:04:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Embed-token-values-in-html-string/m-p/701044#M57475</guid>
      <dc:creator>sglenn1321</dc:creator>
      <dc:date>2024-10-04T18:04:15Z</dc:date>
    </item>
  </channel>
</rss>

