We have put in place a way to access one of our new dashboards without having to do this in the Dashboards menu, but we can take this further and place the rest of our dashboards as menu items across the top of our screen. We can also move the original menu items of search, pivot, alerts, reports and dashboards under one drop down menu. There is not a lot of work to get this done, but we will start over, in this exercise we will make the changes on our development server environment through a text editor or your favorite code editor:
cd $SPLUNK_HOME/etc/apps/nasa_squid_web/local/data/ui/nav/
default.xml
file with a text editor or your favorite code editor and we can get started with our changes.nav
element. The first line will remain the same, and as our search view will remain as search, but we will move our three main dashboards that we created following from that.1 <nav search_view="search" color="#65A637"> 2 <view name="nasa_web_usage" default='true' /> 3 <view name="simplexmldashboard" /> 4 <view name="basic_dashboard" />
nasa_web_usage
dashboard will remain as the default dashboard to be displayed when the SplunkApp is loaded and keeps the default=true
option.Splunk Tools
:5 <collection label="Splunk Tools" >
6 <view name="search" /> 7 <view name="pivot" /> 8 <view name="reports" /> 9 <view name="alerts" /> 10 <view name="dashboards" />
divider
element. Then create a link to the http://www.nasa.gov/ website site with a href
tag, as we would with HTML script.11 <divider /> 12 <a href="https://www.nasa.gov/">NASA Website</a>
nav
elements:13 </collection> 14 </nav>
http://<host:port>/debug/refresh
We have done a lot of work here, and if all works to plan we should be seeing a page similar to the following screenshot. We have our dashboard labels used as the menu items across the top of the SplunkApp. The last menu item also has a downwards arrow, which gives us an indication that there is a drop-down menu, and in this instance the remaining Splunk tools that we added and the current NASA website link divided from the other menu options.
If you need further information on the navigation menu within Splunk Simple XML, it can be found in the reference documentation at the link: http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/BuildNavigation.
Commit your changes, and push them back to GitHub. Deploy to your test environment, test, and deploy to your production environment. We have taken our NASA Squid and Web Data App as far as we will in this book, and it's time for us to move onto our second example, where we use Splunk to create an App to view a biological simulation of cell growth.
3.147.61.142