In the past two recipes of this chapter, you leveraged a method of data summarization called summary indexing to summarize data in a new index, which you then reported on. In this recipe, you will use another method of data summarization known as report acceleration to speed up your report times.
In this recipe, you will create a report to look for the maximum number of concurrent sessions over a time period of 30 days. This report will then be accelerated to speed up the time taken to execute the search.
To step through this recipe, you will need a running Splunk Enterprise server, with the sample data loaded from Chapter 1, Play Time – Getting Data In. You should be familiar with navigating the Splunk user interface and using the Splunk search language.
Follow the steps in this recipe to leverage report acceleration to display the maximum number of concurrent sessions over time:
index=main sourcetype=log4j | timechart span=1m dc(sessionId) AS concurrent_sessions | timechart span=30m max(concurrent_sessions) AS max_concurrent_sessions
cp09_maximum_concurrent_sessions
as the title of the report and select No in the Time Range Picker field. Then, click on Save:maximum
, and click on Open in Search next to the cp09_maximum_concurrent_sessions
report:In this recipe, you first created a search to look for concurrent sessions over time. The search has two timechart
components to it. Let's break down the search piece by piece:
Search fragment |
Description |
---|---|
index=main sourcetype=log4j |
Select to search the application data in the main index. |
| timechart span=1m dc(sessionId) AS concurrent_sessions |
The first |
| timechart span=30m max(concurrent_sessions) AS max_concurrent_sessions |
The second |
This search is actually fairly resource intensive when searched for over an extended period of time. Running the non-accelerated search over 7 days will likely take several minutes, mostly because Splunk performs a calculation for every minute of data for the past week. Once the report is created, you select to accelerate it over a 1-month period. Behind the scenes, Splunk creates an internal summary in line with the data itself. Once the summary is built, you return to the report and rerun it; it completes in seconds, thanks to the new acceleration. As the report is accelerated for an entire month, you can look back up to a month in the past and it will still run fast. Going forward, Splunk will periodically refresh the internal summary every 10 minutes to summarize and accelerate any new event data.
Report acceleration does add some overhead as disk space is used to store the internal summary data. Splunk provides detailed information on the health of the various reports that are accelerated.
To investigate the details of an accelerated report, first click on the Settings menu and then select Report Acceleration Summaries. A list of all accelerated reports will load, together with a high-level build status. Click on the report accelerated in this recipe to drill into the details. The Summary Details screen provides some good insights into the accelerated report, including information on how many times the report has been accessed, the range the report is set at, and how much data is being used by the summary:
3.16.15.149