- Sometimes static ( or fairly consistent data ) appears in a search, but isn't in the index
- Lookups pull this data from standalone files at search time.
- They allow you to add more fields to your events:
- Descriptions for HTTP status codes
- Prices on products
- User information, IPs, workstationIDs, and other tags
- After configuring a lookup, you can use the fields in searches
- Lookup fields also appear in the fields sidebar
- Lookup field values are
case sensitive
by default. - Time based lookups can be created if the lookup values are timestamps
- Upload teh required file for the lookup into Splunk
- Define the lookup type
- Configure the lookup to run ( automatically? )
- Inside of
Settings>Lookups>Lookup Table Files
is a wizard:- Click
New Lookup Table File
- Select the destination
- Enter the name of the lookup and save
- Click
- Is used to load results from a specified static lookup for inspection and review
- Inside of
Settings>Lookups>Lookup Definitions
:- Click
New Lookup Definition
- Select the destination app
- Name the lookup definition
- Select the lookup type ( file or external resource )
- Select the file and save
- Click
Min/Max
the number of matches for each input lookup value- Default the value to output ( when fewer than the min # appear )
- Case sensitivity can be turned off
- Batch Query Index: improves performance for larger files
- Match Types: supplies the format for non-exact matching
- Filter lookups: filters results before returning
- If a lookup is not configured to run automatically, the
lookup
command needs to be used inside of searches.
- Upload the prices.csv lookup
Calculate the sales of each product
| lookup product_lookup productId OUTPUT price product_name
| stats sum(price) as sales by product_name
Steps
-
In Splunk Web, select Settings > Lookups.
-
Under Actions for Automatic Lookups, click Add new.
-
Select the Destination app.
-
Give your automatic lookup a unique Name.
-
Select the Lookup table that you want to use in your fields lookup.
-
In the Apply to menu, select a host, source, or source type value to apply the lookup and give it a name in the named field.
- The first field is the field in the lookup table that you want to match. The second field is a field from your events that matches the lookup table field.
-
Under Lookup output fields provide one or more pairs of output fields.
- The first field is the corresponding field that you want to output to events. The second field is the name that the output field should have in your events.
-
You can select the checkbox for Overwrite field values to overwrite the field values when the lookup runs. Click Save. The Automatic lookup view appears, and the lookup that you have defined is listed.