<?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: Splunk HTML/JS Cache in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329588#M21369</link>
    <description>&lt;P&gt;also, @jeffrey_charbonnet, find me in Slack or IRC. Lots of good resources for stuff like this. &lt;A href="http://splk.it/slack"&gt;http://splk.it/slack&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2017 17:55:53 GMT</pubDate>
    <dc:creator>alacercogitatus</dc:creator>
    <dc:date>2017-06-07T17:55:53Z</dc:date>
    <item>
      <title>Splunk HTML/JS Cache</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329583#M21364</link>
      <description>&lt;P&gt;I am looking to add a Splunk footer link and another div to display a message to the footer. I've made several changes to html and js files without seeing the results in splunkweb though. I've emptied out the cache in splunk/var/run/splunk/appserver, tried the _bump url and set the 3 cache variables in web.conf. I am still unable to see any changes in the webpages.&lt;/P&gt;

&lt;P&gt;Files Changed:&lt;/P&gt;

&lt;P&gt;(added in a test div between the footer tags)&lt;BR /&gt;
- splunk/share/splunk/search_mrsparkle/exposed/build/simplexml/index.js&lt;BR /&gt;
- splunk/share/splunk/search_mrsparkle/exposed/js/build/simplexml.min/config.js&lt;BR /&gt;
- splunk/share/splunk/search_mrsparkle/exposed/js/build/simplexml/config.js&lt;BR /&gt;
- splunk/share/splunk/search_mrsparkle/exposed/js/build/splunkjs.min/config.js&lt;BR /&gt;
- splunk/share/splunk/search_mrsparkle/exposed/js/build/splunkjs/config.js&lt;BR /&gt;
- splunk/shate/splunk/search_mrsparkle/exposed/js/views/shared/Page.js &lt;/P&gt;

&lt;P&gt;(attempted to append to the html)&lt;BR /&gt;
- splunk/share/splunk/search_mrsparkle/exposed/js/splunkjs/mvc/footerview.js&lt;/P&gt;

&lt;P&gt;(added a link)&lt;BR /&gt;
- splunk/share/splunk/search_mrsparkle/exposed/js/views/shared/footer/Master.html&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:19:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329583#M21364</guid>
      <dc:creator>jeffrey_charbon</dc:creator>
      <dc:date>2020-09-29T14:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HTML/JS Cache</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329584#M21365</link>
      <description>&lt;P&gt;Have you tried restarting Splunk?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:49:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329584#M21365</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-06-07T15:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HTML/JS Cache</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329585#M21366</link>
      <description>&lt;P&gt;No, no, no. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; You should &lt;EM&gt;never&lt;/EM&gt; edit &lt;CODE&gt;search_mrsparkle&lt;/CODE&gt;. The better way is to write some JS modules, and include them into the dashboard. This will update your footers dynamically on dashboard load. Much javascript, better, wow. &lt;/P&gt;

&lt;P&gt;EDIT: So, for any links that you want, put them in the &lt;CODE&gt;new_links&lt;/CODE&gt; array. &lt;/P&gt;

&lt;P&gt;Put this in &lt;CODE&gt;$APP_HOME/appserver/static/dashboard.js&lt;/CODE&gt;. Then hit the &lt;CODE&gt;_bump&lt;/CODE&gt; endpoint.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require(['jquery', 'underscore', 'splunkjs/mvc', 'splunkjs/mvc/simplexml/ready!'],
function ($, _, mvc) {
var re = /^footer$/i,
    new_links = [ {"href": "www.google.com", "text": "Google"}]
_(mvc.Components.toJSON()).chain().filter(function (el) {
        var myId = $(el).attr("id") || "undefined",
        should_include = false;
    var isMyIDUndefined = (myId === "undefined");
    if (!isMyIDUndefined) {
        var matches = myId.match(re);
        var isMatchesNull = (matches === null);
        if (!isMatchesNull) {
            should_include = true;
        }
    }
    if (should_include) {
        console.log("returning " + $(el).attr("id"));
        return el;
    }
}).each(function (mytableView) {
    console.log(mytableView);
    var footer_div = $(mytableView.$el[0].childNodes[0].childNodes[0]);
    for (var k = 0; k &amp;lt; new_links.length; k++){
        footer_div.append('&amp;lt;a href="'+new_links[k].href+'" target="_blank"&amp;gt;'+new_links[k].text+'&amp;lt;/a&amp;gt;')
    }
    console.log(footer_div);
});
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Jun 2017 16:05:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329585#M21366</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2017-06-07T16:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HTML/JS Cache</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329586#M21367</link>
      <description>&lt;P&gt;You Sir/Madam are a credit to society and deserve a medal!&lt;/P&gt;

&lt;P&gt;I largely considered this impossible without a large rewrite of their code and nothing to find on Google. Since you're here (the other things I wrote off), instead of dashboard.js, is there another named.js to get the changes site wide? Also, do you happen to have a suggestion on adding a new div to the footer? So the html would read:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;footer role="contentinfo"&amp;gt;
     &amp;lt;div&amp;gt;
          &amp;lt;div class="nav-pages&amp;gt;
              &amp;lt;a href&amp;gt;About&amp;lt;/a&amp;gt;
              &amp;lt;a href&amp;gt;Support&amp;lt;/a&amp;gt;
              &amp;lt;a href&amp;gt;etc...&amp;lt;/a&amp;gt;
          &amp;lt;/div&amp;gt;
          &amp;lt;div class="copyright-pages-enterprise&amp;gt;&amp;lt;/div&amp;gt;
     &amp;lt;/div&amp;gt;
     &amp;lt;new div&amp;gt;&amp;lt;/new div&amp;gt;
&amp;lt;/footer&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Jun 2017 17:48:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329586#M21367</guid>
      <dc:creator>jeffrey_charbon</dc:creator>
      <dc:date>2017-06-07T17:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HTML/JS Cache</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329587#M21368</link>
      <description>&lt;P&gt;Well, I do have a fez. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; Adding a new div is easy. Just modify lines 23-25 in the example to do whatever you feel like to the Footer div.  Append away!&lt;/P&gt;

&lt;P&gt;And no, the most "site wide" you can do is dashboard.js in each app you have. And it only then applies to dashboards. There is not a "globally overwritten" js that I am aware of. &lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 17:52:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329587#M21368</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2017-06-07T17:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HTML/JS Cache</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329588#M21369</link>
      <description>&lt;P&gt;also, @jeffrey_charbonnet, find me in Slack or IRC. Lots of good resources for stuff like this. &lt;A href="http://splk.it/slack"&gt;http://splk.it/slack&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 17:55:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-HTML-JS-Cache/m-p/329588#M21369</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2017-06-07T17:55:53Z</dc:date>
    </item>
  </channel>
</rss>

