All Apps and Add-ons

TabSwitcher was replaced by the Tabs module and the Switcher module

Motivator

In the new version of side view Utils TabSwitcher was replaced by the Tabs module and the Switcher module. I could not find any example where the searches of each tab are independent and not driven by Tabs.name.$selectedTab$.
Can anyone share an example?

Thanks,
Lp

0 Karma

SplunkTrust
SplunkTrust

There isn't a single example in the docs yet that combines Tabs with Switcher. However there is a good documentation page around the Switcher, in which it shows how the Switcher can be driven by a Pulldown module. Since how you configure the Tabs module is practically identical to how you configure the Pulldown module, it's easy to see from here how to use Tabs instead.

but here's a quick example for you. I'll polish this up and add it to the docs.

<module name="Tabs" layoutPanel="panel_row2_col1" autoRun="True">
  <param name="name">selectedTab</param>
  <param name="staticTabs">
    <list>
      <param name="label">Sourcetypes indexed</param>
      <param name="value">sourcetypes</param>
    </list>
    <list>
      <param name="label">Jobs dispatched</param>
      <param name="value">jobs</param>
    </list>
  </param>

  <module name="Switcher" group=" ">
    <param name="selectedGroup">$selectedTab$</param>

    <module name="Search" group="sourcetypes">
      <param name="search"><![CDATA[
        index=_internal source=*metrics.log group="per_sourcetype_thruput" | stats sum(kb) as KB by series | rename series as sourcetype
      ]]></param>
      <param name="earliest">-60min</param>
      <param name="latest">now</param>
      <module name="JobProgressIndicator" />
      <module name="Pager">
        <module name="Table" />
      </module>

    </module>

    <module name="Search" group="jobs">
      <param name="search"><![CDATA[
        index=_internal sourcetype="splunk_web_access" uri="/*/api/search/jobs" method="POST" | rex field=referer ".+/app/(?<app>[^/]+)/(?<view>[^/?]+)" | stats count as jobs by app view | sort - jobs
      ]]></param>
      <param name="earliest">-60min</param>
      <param name="latest">now</param>
      <module name="JobProgressIndicator" />
      <module name="Pager">
        <module name="Table" />
      </module>

    </module>
  </module>
</module>

The great thing about having Tabs and Switcher separately, is that 90% of the time you don't actually need the switching part, because plugging in $selectedTab$ (or whatever your Tabs module's name param is) directly into your Search config or what-have-you, works fine.

Since the above example does use a Switcher, obviously this is standing in for one of the 10% cases where you really need arbitrarily different config to run in the N different branches under the Tabs. As a result this example is a little strange - the searches and the meaning of the two tabs really have nothing whatsoever to do with eachother. 😃

note: Sideview Utils 2.4.4 just released and it has some huge performance improvements. Upgrading is definitely recommended for this one. http://sideviewapps.com/apps/sideview-utils/

Motivator

It worked. Thanks for the example...

Lp

0 Karma
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!