The transaction command is used when you need to group events and preserve the raw event data. This is essential in situations where context is important and you need to maintain the original details of each event. Reference: Splunk Docs - transaction command Splunk Answers - When to use transaction vs stats