How to find correlated messages and time between them

See the discussion here: Using painless to calculate durations