Splunk® Enterprise

Developing Views and Apps for Splunk Web

Splunk Enterprise version 7.2 is no longer supported as of April 30, 2021. See the Splunk Software Support Policy for details. For information about upgrading to a supported version, see How to upgrade Splunk Enterprise.
This documentation does not apply to the most recent version of Splunk® Enterprise. For documentation on the most recent version, go to the latest release.

Use lookups with a view

Important notice: The Advanced XML dashboard framework is officially deprecated. For more information, see Advanced XML Deprecation.

There are many ways to use the lookup feature with views. If you are not familiar with building lookup tables, refer to the "Configure CSV and external lookups" and "Configure KV store lookups" topics in the Knowledge Manager Manual.

Here are a few examples of using lookups in views. There are many different ways to use lookups – these examples give you an idea of the possibilities.

Lookups and dropdowns

This example shows a dashboard that has two dropdowns, one to select country and one to select a city in that country. The city dropdown is populated by a lookup called "citylookup" that dynamically populates the dropdown based on the country selection. The part of the XML that calls the lookup is within the SearchSelectLister module.

. . .
<module name="SearchSelectLister">
  <param name="settingToCreate">pref</param>
  <param name="label">City</param>
  <param name="applyOuterIntentionsToInternalSearch">True</param>
  <param name="search">| inputlookup myLookup2</param>
  <param name="searchFieldsToDisplay">
    <list>
     <param name="label">city</param>
     <param name="value">city</param>
    </list>
  </param>
. . .


Here is the code for the two dropdowns:

. . .
<module name="StaticSelect">
  <param name="settingToCreate">area</param>
  <param name="label">Country</param>
  
  <param name="staticFieldsToDisplay">
    <list>
      <param name="label">USA</param>
      <param name="value">USA</param>
    </list>
    <list>
      <param name="label">Japan</param>
      <param name="value">Japan</param>
    </list>
    <list>
      <param name="label">China</param>
      <param name="value">China</param>
    </list>
    <list>
      <param name="label">Germany</param>
      <param name="value">Germany</param>
    </list>
  </param>
  
    <module name="ConvertToIntention">
      <param name="settingToConvert">area</param>
      <param name="intention">
        <param name="name">addterm</param>
        <param name="arg">
          <param name="area">$target$</param>
        </param>
      </param>

      <module name="SearchSelectLister">
        <param name="settingToCreate">pref</param>
        <param name="label">City</param>
        <param name="applyOuterIntentionsToInternalSearch">True</param>
        <param name="search">| inputlookup citylookup</param>
        <param name="searchFieldsToDisplay">
          <list>
            <param name="label">city</param>
            <param name="value">city</param>
          </list>
        </param>
        
         <module name="ConvertToIntention">
           <param name="settingToConvert">pref</param>
           <param name="intention">
             <param name="name">addterm</param>
             <param name="arg">
               <param name="pref">$target$</param>
             </param>
           </param>
         </module> <!-- End ConvertToIntention -->
         . . .
      </module> <!-- End SearchSelectLister -->
    </module> <!-- End ConvertToIntention -->
</module> <!-- End StaticSelect -->
. . .
Last modified on 13 August, 2019
Lister modules  

This documentation applies to the following versions of Splunk® Enterprise: 7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.0.4, 7.0.5, 7.0.6, 7.0.7, 7.0.8, 7.0.9, 7.0.10, 7.0.11, 7.0.13, 7.1.0, 7.1.1, 7.1.2, 7.1.3, 7.1.4, 7.1.5, 7.1.6, 7.1.7, 7.1.8, 7.1.9, 7.1.10, 7.2.0, 7.2.1, 7.2.2, 7.2.3, 7.2.4, 7.2.5, 7.2.6, 7.2.7, 7.2.8, 7.2.9, 7.2.10, 7.3.0, 7.3.1, 7.3.2, 7.3.3, 7.3.4, 7.3.5, 7.3.6, 7.3.7, 7.3.8, 7.3.9


Was this topic useful?







You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters