# Using Prune Filter To Remove Null Value Fields

**URL:** <https://discuss.elastic.co/t/using-prune-filter-to-remove-null-value-fields/191659>\
**Category:** Logstash\
**Created:** [July 22, 2019, 2:29pm UTC](https://discuss.elastic.co/t/using-prune-filter-to-remove-null-value-fields/191659 "2019-07-22T14:29:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 22, 2019, 2:43pm UTC](https://discuss.elastic.co/t/using-prune-filter-to-remove-null-value-fields/191659/2 "2019-07-22T14:43:25Z")

</div>

No, blacklist\_values takes a hash, each member of which is a field name and a regexp used to determine whether to remove the field. You can do it in ruby

```
    ruby {
        code => '
            event.to_hash.each { |k, v|
                if v.kind_of? String
                    if v == ""
                        event.remove(k)
                    end
                end
            }
        '
    }
```

---

_[View the full topic](https://discuss.elastic.co/t/using-prune-filter-to-remove-null-value-fields/191659)._
