# Matching fields and create new field

**URL:** <https://discuss.elastic.co/t/matching-fields-and-create-new-field/245620>\
**Category:** Kibana\
**Created:** [August 19, 2020, 2:15pm UTC](https://discuss.elastic.co/t/matching-fields-and-create-new-field/245620 "2020-08-19T14:15:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajesh\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajesh_m/32/60701_2.png) [@Rajesh\_M](https://discuss.elastic.co/u/Rajesh_M)\
**Post date:** [August 19, 2020, 2:15pm UTC](https://discuss.elastic.co/t/matching-fields-and-create-new-field/245620/1 "2020-08-19T14:15:05Z")

</div>

Hi,

I have an index with our application logs, which is exported directly to ELK. Below is one of the session log,

```
{"@timestamp": "2020-08-19T13:42:15.236Z", "session": "fdb56d5f", "client": "192.168.1.2", "operation": "login"}
{"@timestamp": "2020-08-19T13:47:42.659Z", "session": "fdb56d5f", "account": "rajesh", "protocol": "ssh", "vcs": "git", "pack": "upload"}

```

Here,

- the first entry is for login and next entry for main operation info.
- we are using only the second entry for visuals.Unfortunately, the client IP is in the first entry.
- **Requirement:** we need to match the session and add a new field in second entry by copying the client ip from first line. any guidance ?

-Thanks

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [August 24, 2020, 4:11pm UTC](https://discuss.elastic.co/t/matching-fields-and-create-new-field/245620/2 "2020-08-24T16:11:52Z")

</div>

Elasticsearch doesn't easily support this kind of session analysis in a single query, but we have a feature called [Transforms](https://www.elastic.co/guide/en/elasticsearch/reference/current/transforms.html) which is capable of joining sessions into a session-oriented instead of time-oriented index.

---

<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:** [September 21, 2020, 4:11pm UTC](https://discuss.elastic.co/t/matching-fields-and-create-new-field/245620/3 "2020-09-21T16:11:57Z")

</div>

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