# filtering by history length

**URL:** <https://discourse.sensu.io/t/filtering-by-history-length/673>\
**Category:** Sensu Classic (EOL)\
**Created:** [September 8, 2016, 9:07am UTC](https://discourse.sensu.io/t/filtering-by-history-length/673 "2016-09-08T09:07:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oded\_Ben\_Ozer](https://avatars.discourse-cdn.com/v4/letter/o/da6949/32.png) [@Oded\_Ben\_Ozer](https://discourse.sensu.io/u/Oded_Ben_Ozer)\
**Post date:** [September 8, 2016, 9:07am UTC](https://discourse.sensu.io/t/filtering-by-history-length/673/1 "2016-09-08T09:07:07Z")

</div>

I was trying to filter out “young checks” (so hosts wouldn’t send alert during provisioning the stage).

Like so

{

“filters”: {

```
"new_checks": {

  "negate": false,

  "attributes": {

    "history": "eval: value.length > 15"

  }

}

```

}

}

This seems to filter _all_ events and the only log message is “event was filtered”, anyone know what’s the issue or how I can debug this behavior?

It might be related to this issue(close but active), but i’m not sure

> <https://github.com/sensu/sensu/issues/1174>
>
> Right now I am configuring an email handler to send an email after a check's status as been critical for a...

---

<div class="post-metadata">

**Author:** ![Philipp\_H](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/philipp_h/32/539_2.png) [@Philipp\_H](https://discourse.sensu.io/u/Philipp_H)\
**Post date:** [September 8, 2016, 3:11pm UTC](https://discourse.sensu.io/t/filtering-by-history-length/673/2 "2016-09-08T15:11:19Z")

</div>

It looks like the history is an array. .count instead of .length might work...

---

<div class="post-metadata">

**Author:** ![Oded\_Ben\_Ozer](https://avatars.discourse-cdn.com/v4/letter/o/da6949/32.png) [@Oded\_Ben\_Ozer](https://discourse.sensu.io/u/Oded_Ben_Ozer)\
**Post date:** [September 8, 2016, 3:30pm UTC](https://discourse.sensu.io/t/filtering-by-history-length/673/3 "2016-09-08T15:30:27Z")

</div>

I think length should work on arrays:

# /opt/sensu/embedded/bin/irb

irb(main):001:0\> [1,4,5,6].length

=\> 4

irb(main):002:0\> [1,4,5,6].count

=\> 4

> **···**
>
> On Thu, Sep 8, 2016 at 6:11 PM, Philipp H [hellmi@gmail.com](mailto:hellmi@gmail.com) wrote:
> 
> > It looks like the history is an array. .count instead of .length might work…
