<?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: Adding javascript without restarting splunk in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115891#M6634</link>
    <description>&lt;P&gt;try holding down shift or ctrl while hitting the refresh button in your browser.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2014 16:52:35 GMT</pubDate>
    <dc:creator>aelliott</dc:creator>
    <dc:date>2014-01-15T16:52:35Z</dc:date>
    <item>
      <title>Adding javascript without restarting splunk</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115890#M6633</link>
      <description>&lt;P&gt;I'm looking at changing a javascript file on a Splunk6 instance which I can not bounce.   I noticed that if I copy the original file to a new one, then reference the new file, it doesn't run.&lt;/P&gt;

&lt;P&gt;Is there a way to force splunk to pickup this change?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard script="custom_viz.js"&amp;gt;
  &amp;lt;row&amp;gt;
           &amp;lt;html&amp;gt;
            &amp;lt;h2&amp;gt;Zone&amp;lt;/h2&amp;gt;
            &amp;lt;div id="custom"&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;/html&amp;gt;
    &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I &lt;/P&gt;

&lt;P&gt;cp custom_viz.js  test.js  &lt;/P&gt;

&lt;P&gt;and change the reference to test.js,  nothing renders.&lt;/P&gt;

&lt;P&gt;These aren't helping any&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="http://YOUR_SERVER:8000/en-US/debug/refresh?entity=/data/ui/views" target="test_blank"&gt;http://YOUR_SERVER:8000/en-US/debug/refresh?entity=/data/ui/views&lt;/A&gt;
&lt;A href="http://YOUR_SERVER:8000/en-US/debug/refresh?entity=/data/ui/nav" target="test_blank"&gt;http://YOUR_SERVER:8000/en-US/debug/refresh?entity=/data/ui/nav&lt;/A&gt;
&lt;A href="http://YOUR_SERVER:8000/en-US/debug/refresh" target="test_blank"&gt;http://YOUR_SERVER:8000/en-US/debug/refresh&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 16:49:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115890#M6633</guid>
      <dc:creator>adylent</dc:creator>
      <dc:date>2014-01-15T16:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding javascript without restarting splunk</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115891#M6634</link>
      <description>&lt;P&gt;try holding down shift or ctrl while hitting the refresh button in your browser.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 16:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115891#M6634</guid>
      <dc:creator>aelliott</dc:creator>
      <dc:date>2014-01-15T16:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adding javascript without restarting splunk</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115892#M6635</link>
      <description>&lt;P&gt;Thanks- but this does not help.   I know that the dashboard is trying to find the new js file because it renders the html block empty when I switch the reference to a file that was created.  When I switch back it works without issue.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 16:59:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115892#M6635</guid>
      <dc:creator>adylent</dc:creator>
      <dc:date>2014-01-15T16:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Adding javascript without restarting splunk</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115893#M6636</link>
      <description>&lt;P&gt;ah it may require a restart of splunk then, may be non avoidable if it's a new js file that you are adding.&lt;/P&gt;

&lt;P&gt;If you were to modify the existing js file, you would not have to restart.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 17:00:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115893#M6636</guid>
      <dc:creator>aelliott</dc:creator>
      <dc:date>2014-01-15T17:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Adding javascript without restarting splunk</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115894#M6637</link>
      <description>&lt;P&gt;You have to restart splunkweb in order for new files to be picked up. The good news is that this is much quicker (typically a couple of seconds) than restarting the whole Splunk instance in (splunkweb + splunkd) and does not affect user sessions or running searches. You can restart splunkweb on the command line:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ splunk restartss
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ splunk restart splunkweb
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(The &lt;CODE&gt;splunk&lt;/CODE&gt; command points to &lt;CODE&gt;$SPLUNK_HOME/bin/splunk&lt;/CODE&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2014 22:52:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115894#M6637</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2014-01-16T22:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Adding javascript without restarting splunk</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115895#M6638</link>
      <description>&lt;P&gt;@ziegfried, in 6.2 there's no separate splunkweb service anymore.  Does that mean I need to do a full Splunk restart to pick up new JS files?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2015 12:36:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115895#M6638</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2015-06-25T12:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adding javascript without restarting splunk</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115896#M6639</link>
      <description>&lt;P&gt;@cphair, it's still the same command to restart the web UI portion.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2015 03:52:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115896#M6639</guid>
      <dc:creator>mvanderlist_spl</dc:creator>
      <dc:date>2015-08-07T03:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Adding javascript without restarting splunk</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115897#M6640</link>
      <description>&lt;P&gt;I tried the below with the splunk instance in my machine,&lt;BR /&gt;
 * Kept the js file inside "/appserver/static" folder of my application&lt;BR /&gt;
 * launched the url &lt;A href="http://127.0.0.1:800/en-US/static/app/MyApp/src/js/karthi.js?123456"&gt;http://127.0.0.1:800/en-US/static/app/MyApp/src/js/karthi.js?123456&lt;/A&gt;&lt;BR /&gt;
 * It opens the content of my screit&lt;BR /&gt;
 * Now,I have modified my code and launched the url &lt;A href="http://127.0.0.1:800/en-US/static/app/MyApp/src/js/karthi.js?**654321**"&gt;http://127.0.0.1:800/en-US/static/app/MyApp/src/js/karthi.js?**654321**&lt;/A&gt;&lt;BR /&gt;
 * it opens the new content...&lt;BR /&gt;
 * So you don't have to refresh or restart splunk.. Just have to change the url.. you can use Math.random() to do so..&lt;/P&gt;

&lt;P&gt;E.G : &lt;A href="http://127.0.0.1:800/en-US/static/app/MyApp/src/js/karthi.js"&gt;http://127.0.0.1:800/en-US/static/app/MyApp/src/js/karthi.js&lt;/A&gt;? + Math.random()&lt;/P&gt;

&lt;P&gt;... But in your case you should not hard code the JS file path in script tag...&lt;BR /&gt;
you should add the script tag dynamically and it to head tag......&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;E.g: jQuery('&amp;lt;script src="/static/app/MyApp/karthi.js?' +Math.random()  + '"/&amp;gt;").appendTo("head");
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Aug 2015 11:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115897#M6640</guid>
      <dc:creator>paramagurukarth</dc:creator>
      <dc:date>2015-08-07T11:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adding javascript without restarting splunk</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115898#M6641</link>
      <description>&lt;P&gt;it Works... great job..&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 08:06:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115898#M6641</guid>
      <dc:creator>chetanjadav</dc:creator>
      <dc:date>2016-07-11T08:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Adding javascript without restarting splunk</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115899#M6642</link>
      <description>&lt;P&gt;To reload any changes done to existing java script we can bump it and create new version.&lt;BR /&gt;
Hit following url &lt;A href="http://server"&gt;http://server&lt;/A&gt; name:8000/en-US/_bump. It will display page, showing current version and button. Click on the button and then all the java script changes will be applied.  However, it may not work if you are adding new file.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 09:28:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115899#M6642</guid>
      <dc:creator>hardikJsheth</dc:creator>
      <dc:date>2016-07-11T09:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Adding javascript without restarting splunk</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115900#M6643</link>
      <description>&lt;P&gt;Note that there are some settings in &lt;CODE&gt;web.conf&lt;/CODE&gt; that can be helpful when developing an apps or other custom UI stuff, but they be unwanted in a production use-case.  You wouldn't want to turn these on then forget about them, as they will impact performance for all users; therefore working from a dedicated "dev" splunk instance is recommended and tweak these settings there.&lt;/P&gt;

&lt;P&gt;The good news is that if you don't already have a dedicated search head for app/view testing and development, it's fairly straightforward to setup a fresh search head and simply connect it to your backend indexers or all-in-one single instance.  This way you can isolate your "production" users from testing/development changes, and at the same time develop more quickly due to fewer restarts.   Even if you have limited server resources, you can launch a second instance of Splunk on the same box, using different ports of course and only run it as-needed.  (You will have manage the copying/deployment of changes between instances.)&lt;/P&gt;

&lt;P&gt;Resources that explain some more options:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://dev.splunk.com/view/webframework-developapps/SP-CAAAE6T"&gt;http://dev.splunk.com/view/webframework-developapps/SP-CAAAE6T&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://answers.splunk.com/answers/315160/how-to-update-splunk-after-javascript-changes-with.html#answer-479092"&gt;https://answers.splunk.com/answers/315160/how-to-update-splunk-after-javascript-changes-with.html#answer-479092&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://answers.splunk.com/answers/205473/what-settings-are-useful-to-develop-a-splunk-app.html"&gt;https://answers.splunk.com/answers/205473/what-settings-are-useful-to-develop-a-splunk-app.html&lt;/A&gt;   (This one is more like a "blog" post via Splunk Answers.  Something I'm sure I've done before too.)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 30 Jun 2017 13:43:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Adding-javascript-without-restarting-splunk/m-p/115900#M6643</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2017-06-30T13:43:34Z</dc:date>
    </item>
  </channel>
</rss>

