# Add data from another record

**URL:** <https://discuss.elastic.co/t/add-data-from-another-record/105026>\
**Category:** Logstash\
**Created:** [October 24, 2017, 9:19am UTC](https://discuss.elastic.co/t/add-data-from-another-record/105026 "2017-10-24T09:19:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jahlives](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@jahlives](https://discuss.elastic.co/u/jahlives)\
**Post date:** [October 24, 2017, 9:19am UTC](https://discuss.elastic.co/t/add-data-from-another-record/105026/1 "2017-10-24T09:19:11Z")

</div>

I wonder if it's possible with logstash to to add a field which is retrieved from another logline?  
My filter currently looks like this

if ("" in [qid] and [qid] == 'proxy-reject') {  
mutate {  
replace =\> ["qid", 'NOQUEUE']  
}  
}

what I want to achive is to add another field which come from another record but can be identified via a pid value

if("" in [qid] and [qid] == 'proxy-reject'){  
mutate {  
replace =\> ["qid", 'NOQUEUE']  
add\_field =\> ["client\_ip", REFERENCE TO ANOTHER RECORD]  
}  
}  
REFERENCE TO ANOTHER RECORD could be determined via a

_exists_:client\_ip and pid:[pid]

So I want to tell logstash to add a field which can be retrieved from client\_ip field of another record with the same pid field as the current record.

Is such thing even possible with logastash?

Thanks a lot for any input

---

<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:** [November 21, 2017, 9:19am UTC](https://discuss.elastic.co/t/add-data-from-another-record/105026/2 "2017-11-21T09:19:23Z")

</div>

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