# How to combine/pair multiple events into single event (consider as a single transaction) based on a rule

**URL:** https://discuss.elastic.co/t/how-to-combine-pair-multiple-events-into-single-event-consider-as-a-single-transaction-based-on-a-rule/240862
**Category:** Elasticsearch
**Created:** [July 12, 2020, 7:56pm UTC](https://discuss.elastic.co/t/how-to-combine-pair-multiple-events-into-single-event-consider-as-a-single-transaction-based-on-a-rule/240862 "2020-07-12T19:56:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kelk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelk](https://discuss.elastic.co/u/kelk)
#### Post date: [July 12, 2020, 7:56pm UTC](https://discuss.elastic.co/t/how-to-combine-pair-multiple-events-into-single-event-consider-as-a-single-transaction-based-on-a-rule/240862/1 "2020-07-12T19:56:06Z")

</div>

Let's consider below sample events,

```auto
_index:windows_security empId:12345 action:create time:0900
_index:windows_security empId:12345 action:delete time:0910

_index:windows_security empId:12345 action:created time:1500
_index:windows_security empId:12345 action:modified time:1510

```

the user have done two actions, one around 09:00 and the other set around 15:00  
I wanted to pair such events so that based on same `empId`, but if actions are done within span of say 15minutes, I want to consider it part of same session.

So ideally I want to see the above outcome to see in 1st session user have created & deleted  
and in the 2nd session user have created and modified.  
How can we achieve in Elastic?  
(In Splunk, there is a `transaction` command to do similar. What's the equivalent in Elasticsearch?)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 9, 2020, 7:56pm UTC](https://discuss.elastic.co/t/how-to-combine-pair-multiple-events-into-single-event-consider-as-a-single-transaction-based-on-a-rule/240862/2 "2020-08-09T19:56:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
