Splunk Fundamentals 1 Lab Exercises: Lab Module 6 - Using Fields in Searches
Splunk Fundamentals 1 Lab Exercises: Lab Module 6 - Using Fields in Searches
NOTE: Lab work will be done on your personal computer or virtual machine, no lab environment is
provided. We suggest you DO NOT do the lab work on your production environment.
The lab instructions refer to these source types by the types of data they represent:
Type Sourcetype Fields of interest
Web Application access_combined_wcookie action, bytes, categoryId, clientip,
itemId, JSESSIONID, productId,
referer, referer_domain, status,
useragent, file
Steps
Scenario: Our web server has been experiencing some down time. The Director of Sales has asked your
team to examine how this has affected sales on the website.
In the app navigation bar (i.e., the bar towards the top of the browser window,) click Search. If you do not
see Search in the application bar – or to clear the previous search - click the App: Search & Reporting in
the Splunk bar at the top of the browser window.
Search for index=main sourcetype=access_combined_wcookie action=purchase for All time.
This returns all events where a purchase action was taken.
NOTE: After the search finalizes, verify that the search executed in Smart Mode. The search mode
displays under the time range picker. If the search did not execute in Smart Mode, change it to
Smart Mode, and then re-execute the search.
Examine the Fields sidebar’s Interesting Fields list. Notice that productId is one of the fields extracted
by Splunk.
In the Fields sidebar, under Interesting Fields, click productId. Notice the pop-up window shows the top
ten purchased products by productId. Close the window by clicking the x in the upper right corner.
In the Fields sidebar, under Interesting Fields, click status. This field contains the status of the web
request. Anything greater than 200 means that the customer interaction ended in an error, and the
purchase was not made.
Results Example
To quickly view the status for each event, you can make it selected. From the status field window, click
Yes in the upper right corner next to Selected. Close the window by clicking the x in the upper right
corner.
Notice status is now a selected field in the Fields sidebar and status=value is displayed below each
event.
Results Example
Click Search History to view your past search history. Unlike jobs, which save the results of your search
for a short time, here you only see your search criteria, which are saved for a long time. You will often have
many searches. You can filter by time or content to find a search.
Click inside the Search History filter box, and type purchase. Notice the search list is shortened. Only the
searches that contain the word purchase remain.
Results Example
For one of the searches, click Add to Search. Notice that the search criteria appears in the Search bar,
but the time range still displays the default setting.
Change the time range, optionally add to or change the search criteria, and then execute the search.
Task 3: View your recent searches using the Jobs page.
In the Splunk bar (which is the black bar towards the top of the browser window), click Activity > Jobs.
Look at the search strings to see if there were any keystroke mistakes. You may see listings like " |
metadata ... " or " | history ... ", which appear when you have accessed the Expand your
search history.