- Splunk Operational Intelligence Cookbook
- Josh Diakun Paul R Johnson Derek Mock
- 216字
- 2025-04-04 16:53:02
How to do it...
Follow these steps to search and calculate web page response time statistics over the past week:
- Log in to your Splunk server.
- Select the Search & Reporting application.
- 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:
sourcetype=access_combined | timechart span=6h avg(response) AS avg_response | eval avg_response=round(avg_response/1000,2)
- Splunk will return a tabulated list, detailing the average response times for every six-hour period going back a week, as shown in the following screenshot:
- This is great, but is hard to visualize in tabular form. Click on the Visualization tab, and you will see this data represented as a chart.
- Click on the chart type link in the upper-left of the chart (next to the Format link) and select Line if not already selected. Splunk now presents this data in a nice line chart as shown in the following screenshot, and we can now see the average response times at different times of the day much more clearly:
- Save this search by clicking on Save As and then on Report. Give the report a name of cp02_webpage_response_times and click on Save. On the next screen, click on Continue Editing to return to the search.