# How to check, if a hash is empty (no keys)

**URL:** <https://discuss.elastic.co/t/how-to-check-if-a-hash-is-empty-no-keys/93227>\
**Category:** Logstash\
**Created:** [July 14, 2017, 5:56pm UTC](https://discuss.elastic.co/t/how-to-check-if-a-hash-is-empty-no-keys/93227 "2017-07-14T17:56:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 14, 2017, 7:37pm UTC](https://discuss.elastic.co/t/how-to-check-if-a-hash-is-empty-no-keys/93227/2 "2017-07-14T19:37:57Z")

</div>

I don't think the Logstash configuration language really has hash literals in the same way it has array literals in which case this isn't possible except with a ruby filter.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-check-if-a-hash-is-empty-no-keys/93227)._
