All Apps and Add-ons

link_switcher.js doesn't work

clairebesson
Explorer

Hi everyone ! I am trying to create a menu with link switcher. I have tested the example of custom_link_switcher in Splunk 6.x. Dashboards Examples in my own dashboard. And it didn't work.
<dashboard script="link_switcher.js, autodiscover.js">

<row grouping="4">
    <html>
        <!-- Placeholder/container for the link switcher to appear -->
        <div class="link-switcher" data-items="link1,link2,link3">Select a view: <!--Links go here--></div>
    </html>
    <table id="link1">
        <title>Table</title>
        <searchString>index=_internal | stats count by sourcetype</searchString>
        <earliestTime>-24h</earliestTime>
    </table>
    <chart id="link2">
        <title>Chart</title>
        <searchString>index=_internal | stats count by sourcetype</searchString>
        <earliestTime>-24h</earliestTime>
    </chart>
    <map id="link3">
        <title>Map</title>
        <searchString>| inputlookup geomaps_data.csv | iplocation device_ip | geostats latfield=lat longfield=lon count by method</searchString>
        <earliestTime>0</earliestTime>
        <option name="mapping.map.center">(30.810646,-10.556976)</option>
        <option name="mapping.map.zoom">2</option>
    </map>
</row>

</dashboard>

I implemented this code and I had this dashboard :alt text

As you can see the 3 panels are in the dashboard and there is no link switcher.
Could you please help me with that ?
Thanks in advance.

0 Karma
1 Solution

alacercogitatus
SplunkTrust
SplunkTrust

The autodiscover.js and link_switcher.js files need to be placed in $APP_HOME/appserver/static, where $APP_HOME is the name of the App your dashboard is located. Once they are in that folder, restart Splunk.

If you want to break all caches, click the button at: https://your_splunk/en-US/_bump.

View solution in original post

alacercogitatus
SplunkTrust
SplunkTrust

The autodiscover.js and link_switcher.js files need to be placed in $APP_HOME/appserver/static, where $APP_HOME is the name of the App your dashboard is located. Once they are in that folder, restart Splunk.

If you want to break all caches, click the button at: https://your_splunk/en-US/_bump.

clairebesson
Explorer

My dashboards are in the app "Search & Reporting" (folder name: search). I tried search/appserver/static but it didn't work : "Page not found"

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

"Page Not Found" --- what page? the dashboard? Can you paste the entire 404 error? from the developer console?

0 Karma

clairebesson
Explorer

that's good now thanks

0 Karma

jeffland
SplunkTrust
SplunkTrust

Just to make sure, you did put the .js files in the right places, restarted your splunk and reloaded your browser page without cache (STRG-F5)?

0 Karma

clairebesson
Explorer

Thanks for your answer
The problem is that I don't know where I have to put the .js files with Splunk (I am a very beginner ! )

0 Karma
Get Updates on the Splunk Community!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...