# Skip indexing document with null value

**URL:** <https://discuss.elastic.co/t/skip-indexing-document-with-null-value/92373>\
**Category:** Logstash\
**Created:** [July 8, 2017, 8:26pm UTC](https://discuss.elastic.co/t/skip-indexing-document-with-null-value/92373 "2017-07-08T20:26:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![saisn](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@saisn](https://discuss.elastic.co/u/saisn)\
**Post date:** [July 8, 2017, 8:26pm UTC](https://discuss.elastic.co/t/skip-indexing-document-with-null-value/92373/1 "2017-07-08T20:26:28Z")

</div>

Hi,

I'm importing data from sql to elasticsearch using logstash.  
Is there a way in logstash to skip indexing document with null value.

Thanks,  
Sai N

---

<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 11, 2017, 8:19pm UTC](https://discuss.elastic.co/t/skip-indexing-document-with-null-value/92373/2 "2017-07-11T20:19:51Z")

</div>

Yes, but Logstash's configuration language doesn't have a concept of "null" so you need to use a Ruby filter.

But why not adjust the SQL query to not return null values in the first place?

---

<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:** [August 8, 2017, 8:20pm UTC](https://discuss.elastic.co/t/skip-indexing-document-with-null-value/92373/3 "2017-08-08T20:20:17Z")

</div>

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