You would utilize the stats command to find an average of the diff_seconds field using a by-field of search_name. Something like this (following the search I shared before) index=notable
...
See more...
You would utilize the stats command to find an average of the diff_seconds field using a by-field of search_name. Something like this (following the search I shared before) index=notable
| eval
event_epoch=if(
NOT isnum(event_time),
strptime(event_time, "%m/%d/%Y %H:%M:%S"),
'event_time'
),
orig_epoch=if(
NOT isnum(orig_time),
strptime(orig_time, "%m/%d/%Y %H:%M:%S"),
'orig_time'
)
| eval
event_epoch_standardized=coalesce(event_epoch, orig_epoch),
diff_seconds='_time'-'event_epoch_standardized'
| fields + _time, search_name, event_time, diff_seconds
| stats
count as sample_size,
min(diff_seconds) as min_diff_seconds,
max(diff_seconds) as max_diff_seconds,
avg(diff_seconds) as avg_diff_seconds
by search_name
| eval
avg_diff=tostring(avg_diff_seconds, "duration")