# How to get maximum value of field in events?

**URL:** <https://discuss.elastic.co/t/how-to-get-maximum-value-of-field-in-events/24167>\
**Category:** Logstash\
**Created:** [June 23, 2015, 9:22am UTC](https://discuss.elastic.co/t/how-to-get-maximum-value-of-field-in-events/24167 "2015-06-23T09:22:23Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 23, 2015, 10:09am UTC](https://discuss.elastic.co/t/how-to-get-maximum-value-of-field-in-events/24167/4 "2015-06-23T10:09:57Z")

</div>

Well, you seem to be on the right track given your other post (below). Please try to keep related questions together.

> [@"hash=event\['field'\].to\_hash" instead "hash = event.to\_hash"](https://discuss.elastic.co/t/hash-event-field-to-hash-instead-hash-event-to-hash/24169):
>
> Is it possible... I want to traverse through events against specific field. something like: hash = event['field1'].to\_hash hash.each { |event['field1'], v| puts event['field1'] if v == hash.values.max } Any help?

---

_[View the full topic](https://discuss.elastic.co/t/how-to-get-maximum-value-of-field-in-events/24167)._
