filtering by history length

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

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

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 wrote:

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