Tyler Younger from the RBA Slack contributed this handy method for including some useful history of risk notables for that risk object when it fires. I played with it a bit and created a version I might use in a dashboard for additional context. You should check with your analysts to see what would be most helpful for them.
You could add this subsearch to your Risk Incident Rules and add this field to Incident Review Settings so analysts see it reviewing a notable event, or maybe have it as a panel in an investigation dashboard. I will leave it with the makeresults and tabled results as an example so you can play around until it looks right.
|makeresults
|evalrisk_object="tyounger"|jointype=leftmax=0risk_object
[|searchearliest=-31dlatest=now`notable````### This may or may not make sense in your enviornment, the idea was to tidy up the search names, adjust as needed```|replace"* - Rule"WITH*INsearch_name
|replace"Audit - UC - *"WITH*INsearch_name
|replace"Threat - UC - *"WITH*INsearch_name
|replace"Access - UC - *"WITH*INsearch_name
|replace"Network - UC -*"WITH*INsearch_name
|replace"Identity - UC -*"WITH*INsearch_name
|replace"Endpoint - UC -*"WITH*INsearch_name
```### ```|eventstatscountashistory_countdc(search_name)assearch_name_countvalues(search_name)assearch_namesfirst(_time)aslast_timebyrisk_object,search_name
|evaldays_ago=round((abs(last_time-now())/86400),2)|convertctime(first_time)asfirst_time
|convertctime(last_time)aslast_time
|evalhistory_count=if(isnull(history_count)," new",history_count)|evalsearch_names=if(isnull(search_names)," search null",search_names)|evallast_time=if(isnull(last_time)," last time null",last_time)|evaldays_ago=if(isnull(days_ago)," days ago null",days_ago)|fillnullcommentvalue="N/A"|tablerisk_objectsourcesrule_namehistory_countrisk_objectfirst_timelast_timesearch_name_countsearch_namesdays_agostatus_labelcomment
]```### Format history fields ### ```|evalnotable_risk_history="(".risk_object.") previously alerted ".history_count." times with the following notable(s) [".search_names."]"." with status label(s) (".status_label.") most recently on [".last_time."] ".days_ago." days ago. comment(s) comments: (".comment.")"|evalnotable_risk_history=if(isnull(notable_risk_history),"Risk object has not generated any notable events",notable_risk_history)|evalsearch_names=if(isnull(search_names),"N/A",search_names)|makemvdelim="comments: "notable_risk_history
|evalnotable_risk_history=mvjoin(notable_risk_history,"")|tablerisk_objectnotable_risk_history
You should be able to simply use the join and logic all the way up to the final table command and perhaps make a macro for this to be added to the end of your Risk Incident Rules and provide that context.
You might want to check other fields in regular notables to see if this risk object appears there as well. In this example, I am using coalesce to check src, dest, and user and bring those in on the join. I'm also playing with the spacing and formatting of the final results in case that gives you some ideas:
|makeresults
|evalrisk_object="gravity"|jointype=leftmax=0risk_object
[|searchearliest=-5000dlatest=now`notable````### This may or may not make sense in your enviornment, the idea was to tidy up the search names, adjust as needed```|replace"* - Rule"WITH*INsearch_name
|replace"* - Combined"WITH*INsearch_name
|replace"Audit - *"WITH*INsearch_name
|replace"Threat - *"WITH*INsearch_name
|replace"Access - *"WITH*INsearch_name
|replace"Network -*"WITH*INsearch_name
|replace"Identity -*"WITH*INsearch_name
|replace"Endpoint -*"WITH*INsearch_name
```### ```|evalrisk_object=coalesce(risk_object,src)|evalrisk_object=coalesce(risk_object,dest)|evalrisk_object=coalesce(risk_object,user)|evalcomment="|||---- ".comment
|eventstatscountashistory_countdc(search_name)assearch_name_countvalues(search_name)assearch_nameslatest(_time)aslast_timelatest(status_label)asstatus_labelvalues(comment)ascommentsbyrisk_object,search_name
|deduprisk_object,search_name
|convertctime(last_time)aslast_time
|fillnullhistory_countsearch_nameslast_timevalue="N/A"|fillnullcommentsvalue="---- no comments"|evalcomments=mvjoin(comments,"")|tablerisk_objecthistory_countrisk_objectlast_timetimesearch_name_countsearch_namestatus_labelcomments
]```### Format history fields ### ```|evalnotables=last_time." - ".history_count." - ".search_name." :: ".upper(status_label)."|||".comments
|statssum(history_count)ashistory_countvalues(notables)asnotablesbyrisk_object
|evalnotables=mvjoin(notables,"||| |||-- ")|evalnotable_history="(+. ".upper(risk_object)." .+) previously alerted ".history_count." times with the following notable(s):||| |||-- ".notables
|evalnotable_history=split(notable_history,"|||")|fields-notableshistory_count
|evalnotable_history=if(isnull(notable_history),"Risk object has not generated any notable events",notable_history)
Either way, letting your analysts know what was seen before is helpful context when they begin investigating.