How to do it...

Follow these steps to search for the top products being searched over the past week:

  1. Log in to your Splunk server.
  2. Select the Search & Reporting application.
  1. Ensure that the time range picker is set to Last 7 days and type the following search into the Splunk search bar. Then, click on Search or hit Enter:
index=main sourcetype=access_combined uri_path="/viewItem" OR uri_path="/addItem" status=200  | dedup JSESSIONID uri_path item | chart count(eval(uri_path="/viewItem")) AS view, count(eval(uri_path="/addItem")) AS add by item | sort - view | head 10
  1. Splunk will return a tabulated list of items (products), detailing the number of times a product was successfully viewed versus the number of times a product was actually added to the shopping cart, as shown in the following code:
  2. Save this search by clicking on Save As and then on Report. Give the report a name of cp02_top_products_viewed and click on Save. On the next screen, click on Continue Editing to return to the search.