How to do it...

Follow the steps in this recipe to calculate the average session time on a website:

  1. Log in to your Splunk server.
  2. Select the Operational Intelligence application.
  3. Ensure the time range picker is set to Last 24 Hours, and type the following search into the Splunk search bar. Then, click on the magnifying glass button or hit Enter:
index=main sourcetype=access_combined | transaction  JSESSIONID | stats avg(duration) AS Avg_Session_Time 
  1. Splunk will return a single value representing the average duration in seconds for a session on the website.
  2. Click on the Visualization tab.
  3. Since there are a number of visualizations within Splunk, the single-value visualization might not be displayed by default within the Visualization

Get Splunk Operational Intelligence Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.