# Trying to copy value of event into map if not nil or 0

**URL:** <https://discuss.elastic.co/t/trying-to-copy-value-of-event-into-map-if-not-nil-or-0/100022>\
**Category:** Elasticsearch\
**Created:** [September 11, 2017, 9:11am UTC](https://discuss.elastic.co/t/trying-to-copy-value-of-event-into-map-if-not-nil-or-0/100022 "2017-09-11T09:11:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [September 11, 2017, 9:12am UTC](https://discuss.elastic.co/t/trying-to-copy-value-of-event-into-map-if-not-nil-or-0/100022/1 "2017-09-11T09:12:00Z")

</div>

Hi I am trying to copy value of event into map if not nil or 0, but I am getting a "\_aggregateexception" error. I will be happy for help:  
I am writing in the code part:  
event.each { |k, v|

> if( event[k] != nil)  
> if(event[k].eql? '0')  
> #do nothing  
> else  
> map[k] = event[k]  
> end  
> end  
> }

---

<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:** [October 9, 2017, 9:12am UTC](https://discuss.elastic.co/t/trying-to-copy-value-of-event-into-map-if-not-nil-or-0/100022/2 "2017-10-09T09:12:10Z")

</div>

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