This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the same dataset that you will have already downloaded and ingested into Splunk. If not, please go to the Tutorial and complete it (or at least download and ingest the dataset).
This is the seventh blog in the series, and builds on the dashboard created in the previous blogs.
From the details chart, we now want to look at events from the time period which match the various status values. This is done by enabling the drilldown capability of the chart. Depending on which part of the chart is clicked, the resulting table should show various events matching the drilldown criteria.
First, you can create a table that displays the events from the details chart. Later, you will add filtering based on which area of the chart is clicked.
sourcetype=access_combined_wcookie earliest=$zoom.earliest$ latest=$zoom.latest$
| eventstats count as _count
| streamstats count as _row
| eval Event=_row."/"._count
| table Event _time clientip method file action productId itemId categoryId status
This screen image shows the events statistics table being added to the dashboard.
This search also overrides the earliest and latest values so there is no need to change the Time Range settings.
You may have noticed that the statistics table is still visible even when no time period has been selected, and that there is an error message in the table instead of some events. You will be fixed in the next section.
The events statistics table will be filtered depending on what the user has clicked on in the details chart. This capability is called drilldown. From the chart, the user has a number of options to modify the events filter; they can click on a bar in the details chart; they can click on an item in the legend of the chart; or, they can click on one of the overlay lines.
You will implement these options in the drilldown section of the details chart in the following way.
<drilldown>
<eval token="drilldown.series">if(isnull($click.name$),null(),$drilldown.series$)</eval>
<eval token="drilldown.series">case($click.name2$=="threshold" or $drilldown.series$ == $click.name2$,null(),isnull($drilldown.series$),$click.name2$,isnull(mvfind(split($drilldown.series$,","),$click.name2$)),mvjoin(mvdedup(mvappend(split($drilldown.series$,","),$click.name2$)),","),true(),replace(replace($drilldown.series$,",".$click.name2$,""),$click.name2$.",",""))</eval>
<eval token="drilldown.choice">if(isnull($drilldown.series$),"","status IN (".$drilldown.series$.")")</eval>
<set token="drilldown.status">$click.name2$</set>
</drilldown>
"This screen image shows the drilldown handling for the details chart.
The drilldown handler works in the following manner
<option name="charting.drilldown">all</option>
This screen image shows the drilldown enabled for the details chart.
Having set up the tokens in the drilldown handler, you now need to use the tokens in the events statistics table
<row depends="$drilldown.status$">
<title>Requests $zoom.period$ $drilldown.choice$</title>
sourcetype=access_combined_wcookie earliest=$zoom.earliest$ latest=$zoom.latest$ $drilldown.choice$
| eventstats count as _count
| streamstats count as _row
| eval Event=_row."/"._count
| table Event _time clientip method file action productId itemId categoryId status
This screen image shows the events statistics table being amended to use the drilldown tokens.
Since we are now using some tokens to determine when to show the event statistics table, you should unset these whenever the time period selection is changed.
<selection>
<eval token="zoom.earliest">if($start$ = $beginning$ and $end$ = $ending$, null(), $start$)</eval>
<eval token="zoom.latest">if($start$ = $beginning$ and $end$ = $ending$, null(), $end$)</eval>
<eval token="zoom.period">"from ".strftime($zoom.earliest$,"%F %H:%M")." to ".strftime($zoom.latest$,"%F %H:%M")</eval>
<unset token="drilldown.series"></unset>
<unset token="drilldown.status"></unset>
</selection>
This screen image shows the updated selection handler unsetting drilldown tokens.
Try clicking on other status bars, lines and the chart legend to see which statistics are shown in the table.
Next step is to go on to part 8 where you create an alternative way of comparing hourly rates with the previous few days.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.