If you're utilizing a custom risk notable investigation dashboard, it can be incredibly helpful for each risk event source to have its own drilldown. Thanks to Donald Murchison from the RBA Slack for contributing this method, which is explained in more detail in this blog post.
In Donald's example, this panel shows the list of sources for the risk object indicated by $risk_object_token$ (which you will need to ensure matches whatever token your dashboard uses), a description, and the drilldown logic itself. Here is the SPL and helpful comments:
|tstatssummariesonly=falsecountfromdatamodel=Risk.All_RiskwhereAll_Risk.risk_object="$risk_object_token$"bysource```Getalistofallriskrulesthathavegeneratedariskeventforthisriskobject-assumesthedashbaordhasaninputwhichstoresrisk_objectin"risk_object_token"replacerisk_object_tokenwithyourowntokenname-helpfultouserisk_object_typeinsearchifthisisinatokenaswell```|fieldssource```Usemaptorunasearchforeachriskruletogeneratethedrilldowns-mapwasusedtobeabletopasstheriskrulenameasanargumenttothesubsearch.
Thisisrequiredbecausewemustrunanindividual"| eval drilldown=…"foreachriskruleincasefieldsareusedinthedrilldownthatdonotexistinotherriskevents.
Stringconcatentationwithanullfieldwouldmakeourentirestringnull.
Ifyouwantedtoremovemapforbetterperformanceyoucoulddothisbyonlyusingfieldsthatarepresentineveryriskruleorbuildingdrilldownswithcoalesce-coalesce(risk_object,\"\")-toensurenonullfields```|mapsearch="index=risk risk_object=\"$risk_object_token$\" | eval drilldown=[| inputlookup rba_risk_rule_drilldowns.csv | eval search_name=split(search_name,\"|\") | search search_name=\"$$source$$\" | eval drilldown=\"\\\"\".search_name.\"||@||\\\".\".drilldown.\".\\\"||@||\".description.\"\\\"\"``` In the map search, we first search for all risk events related to the risk rule. Every risk event will get a drilldown field that we will dedup later. We do not use the datamodel in case fields outside of the datamodel are used in the drilldown.The |inputlookup subsearch concatenates search_name, drilldown, and description for each row```| stats values(drilldown) as drilldown| eval drilldown=mvjoin(drilldown,\".\\\"||&||\\\".\")``` We then condense all drilldowns to a single field and concatenate together - this allows us to evaluate all drilldowns within a single eval statement```|return $drilldown] | fields drilldown"```Nowwebreakoutthedrilldownsintotheirrespectivecomponents```|evaldrilldown=split(drilldown,"||&||")|mvexpanddrilldown
|evalsearch_name=mvindex(split(drilldown,"||@||"),0)|evaldrilldown_description=mvindex(split(drilldown,"||@||"),2)|evaldrilldown=mvindex(split(drilldown,"||@||"),1)|statsvalues(*)as*bydrilldown
```Usestatstodedupthedrilldowns-dependingonthefieldsusedinthedrilldowntherecouldbemultiplevariationsofthesamedrilldown```|tablesearch_namedrilldown_descriptiondrilldown
So you could use $row.lowtime$ and $row.hightime$ for your drilldown and search a five minute window around an event instead of utilizing the standard time picker for your dashboard.