# NullPointerException in logstash filter throttle

**URL:** <https://discuss.elastic.co/t/nullpointerexception-in-logstash-filter-throttle/190464>\
**Category:** Logstash\
**Created:** [July 15, 2019, 8:29am UTC](https://discuss.elastic.co/t/nullpointerexception-in-logstash-filter-throttle/190464 "2019-07-15T08:29:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![floflo](https://avatars.discourse-cdn.com/v4/letter/f/6f9a4e/32.png) [@floflo](https://discuss.elastic.co/u/floflo)\
**Post date:** [July 15, 2019, 8:29am UTC](https://discuss.elastic.co/t/nullpointerexception-in-logstash-filter-throttle/190464/1 "2019-07-15T08:29:40Z")

</div>

Hi there,

I am currently trying to make the Throttle plugin work in logstash (7.2.0) but some nasty NullPointerException occurs and I can't manage to understand why from the stack trace. Any idea ?

Filter config:

```auto
filter {
  # ...

  if ![jsonQueryPlan]{
    drop{}
  }

  if ![jsonQueryPlan][Query Text] {
    drop{}
  }

  throttle {
    before_count => -1
    after_count => 1
    period => 10
    max_age => 20
    key => "%{[jsonQueryPlan][Query Text]}"
    add_tag => "throttled"
  }

  if "throttled" in [tags] {
    drop {}
  }
}

```

And the stack trace (the error doesn't occur right from the beginning):

> <https://gist.github.com/FloChehab/bf181d77d196c0acec38eb549d5fb5e8>

Thanks for your help.

---

<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 12, 2019, 8:29am UTC](https://discuss.elastic.co/t/nullpointerexception-in-logstash-filter-throttle/190464/2 "2019-08-12T08:29:46Z")

</div>

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