Calculating process duration using Carbon Black and Splunk
Update: See "An easier method of finding duration of processes" to simplify this. I came across this interesting tweet from @subTee that got me interested in not just this TTP but looking at process durations in general. That could be a good method to have in the toolbox. It makes sense that userinit.exe should not run for long so I looked to see how I could calculate the duration using Carbon Black process logs. One method of calculating values where you need timestamps from two different events is to use the Splunk streamstats command but I try to avoid it because it can be slow. Luckily Carbon Black shows an event for both process start and process stop which has the timestamps so I just needed to get them together. field name "type" contains process start or process stop field name process_guid contains the unique id for the process Calculate the duration of the process index=edr event_type=proc process_path=*\\userinit.exe | stats values(type) ...