# How to filter data from beat in logstash

**URL:** <https://discuss.elastic.co/t/how-to-filter-data-from-beat-in-logstash/263418>\
**Category:** Logstash\
**Created:** [February 5, 2021, 3:31pm UTC](https://discuss.elastic.co/t/how-to-filter-data-from-beat-in-logstash/263418 "2021-02-05T15:31:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IL\_Mare](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/il_mare/32/83492_2.png) [@IL\_Mare](https://discuss.elastic.co/u/IL_Mare)\
**Post date:** [February 5, 2021, 3:31pm UTC](https://discuss.elastic.co/t/how-to-filter-data-from-beat-in-logstash/263418/1 "2021-02-05T15:31:17Z")

</div>

Hello. I need to add data comes from beats to ElasticSearch. But before I need to filter to keep only records that have "status" and status is not "sent". I wrote next configuration for it.

```auto
input {
  beats {
    port => 5055
  }
}

filter {
  if ["status="] not in [message] {
    drop{}
  }
  if ["status=sent"] in [message] {
    drop{}
  }
}

```

As result I got "TypeError: can't convert nil into String". I suppose the reason is "message" field but I didn't manage to understand the name of field that contain all text. Thanks for responses.

PS: The data to beats sent from filebeat.

---

<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:** [March 5, 2021, 3:31pm UTC](https://discuss.elastic.co/t/how-to-filter-data-from-beat-in-logstash/263418/2 "2021-03-05T15:31:55Z")

</div>

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