Use lookups with a view
This documentation does not apply to the most recent version of Splunk. Click here for the latest version.
Contents
Use lookups with a view
There are many ways to use Splunk's lookup feature with views. If you're not familiar with building lookup tables in Splunk, refer to the "Look up fields from external data sources" topic 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 -->
. . .
This documentation applies to the following versions of Splunk: 4.3 , 4.3.1 , 4.3.2 , 4.3.3 , 4.3.4 , 4.3.5 , 4.3.6 View the Article History for its revisions.