Installation

Navigation menu dropdown default.xml migration to Splunk 6

aaronkorn
Splunk Employee
Splunk Employee

Hello,

Is there any documentation out there on migration to Splunk 6 regarding nav menus and the default.xml file? We have numerous dashboards grouped into different match categories that didn't seem to be grouped in our dev environment after going from 5 to 6.

0 Karma
1 Solution

gmor
Explorer

Hi,

I've also been looking at this and it is possible.

Assuming that you're working with the 'Search' app, you can take most of what is in:

/opt/splunk/etc/apps/search/local/data/ui/nav/default.xml

in Splunk 5 and use it with Splunk 6, by creating a similar file in the same location.

For example, we use the <collection> tag to group Dashboards together.

So the 'default' default.xml for the Search App looks like this:

<nav search_view="search" color="#65A637">
  <view name="search" default='true' />
  <view name="data_models" />
  <view name="reports" />
  <view name="alerts" />
  <view name="dashboards" />
</nav>

You could change this to include all your dashboards by doing:

<nav search_view="search" color="#65A637">
  <view name="search" default='true' />
  <view name="data_models" />
  <view name="reports" />
  <view name="alerts" />
  <collection label="Dashboards" >
    <view name="dashboards" />
    <divider />
    <view source="unclassified" />
  </collection>
</nav>

If you've worked with <collection> tag in Splunk 5, you should be able to do the same in Splunk 6. You can use the 'match="xxx"' to create dynamic menus, as described here: http://docs.splunk.com/Documentation/Splunk/6.0/AdvancedDev/BuildNavigation

One slight downside with this in Splunk 6, is that the drop-down menus have a maximum height, so you then have to scroll inside them. You could probably fix this by hacking away at the .css, but this seems a bit overkill.

Hopefully the UI people at Splunk will see the value in having drop-down menus without internal scroll bars. Please just make it work like Splunk 5!

Cheers,

Graham

View solution in original post

gmor
Explorer

Hi,

With regard to 'aaronkorn's comment above...

I haven't found a successful way of changing the height, but you could play around with the "max-height:" variable in ".dropdown-menu ul":

/opt/splunk/share/splunk/search_mrsparkle/exposed/css/bootstrap.min.css

I changed it to 1000px, which works up to a point, but breaks other menus, as the element is used elsewhere.

I wouldn't recommend it.

This is the full line in that file if you want to search for it.

.dropdown-menu ul{list-style:none;margin:0;border:1px solid #a9a9a9;border-bottom-color:#909090;border-top-color:#b6b6b6;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;background-color:#ffffff;*zoom:1;overflow-x:hidden;overflow-y:auto;*position:relative;max-width:100%;max-height:270px;box-sizing:border-box;}.dropdown-menu ul:before,.dropdown-menu ul:after{display:table;content:"";line-height:0;}
0 Karma

gmor
Explorer

Hi,

I've also been looking at this and it is possible.

Assuming that you're working with the 'Search' app, you can take most of what is in:

/opt/splunk/etc/apps/search/local/data/ui/nav/default.xml

in Splunk 5 and use it with Splunk 6, by creating a similar file in the same location.

For example, we use the <collection> tag to group Dashboards together.

So the 'default' default.xml for the Search App looks like this:

<nav search_view="search" color="#65A637">
  <view name="search" default='true' />
  <view name="data_models" />
  <view name="reports" />
  <view name="alerts" />
  <view name="dashboards" />
</nav>

You could change this to include all your dashboards by doing:

<nav search_view="search" color="#65A637">
  <view name="search" default='true' />
  <view name="data_models" />
  <view name="reports" />
  <view name="alerts" />
  <collection label="Dashboards" >
    <view name="dashboards" />
    <divider />
    <view source="unclassified" />
  </collection>
</nav>

If you've worked with <collection> tag in Splunk 5, you should be able to do the same in Splunk 6. You can use the 'match="xxx"' to create dynamic menus, as described here: http://docs.splunk.com/Documentation/Splunk/6.0/AdvancedDev/BuildNavigation

One slight downside with this in Splunk 6, is that the drop-down menus have a maximum height, so you then have to scroll inside them. You could probably fix this by hacking away at the .css, but this seems a bit overkill.

Hopefully the UI people at Splunk will see the value in having drop-down menus without internal scroll bars. Please just make it work like Splunk 5!

Cheers,

Graham

aaronkorn
Splunk Employee
Splunk Employee

Perfect. Just what I needed! Any idea which stylesheet sets the height of the drop down?

0 Karma

ChrisG
Splunk Employee
Splunk Employee

There is a Changes for Splunk app developers topic in the upgrade chapter of the Installation Manual. I don't see your specific issue there, though, unless you have JavaScript in your default.xml file.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...