@cnoulin as @somesoni2 mentioned, stats is a better option for your use case. However, for us to assist you better you would need to provide more details on what fields and values you want to show after correlating them. If you lookup Splunk Answers you will find several examples.
sourcetype="cisco:esa:textmail"
| stats count as eventCount min(_time) as _time max(_time) as LatestTime internal_message_id
| eval duration=LatestTime-_time
| fields - LatestTime
... View more