Multiple conditions on compare


(Mww) #1

how can we write multiple compare condition in xpack?

"condition" : {
    "compare" : {
      "ctx.payload.status" : { "eq" : "red" }
    }
  }

I want to have two conditions, one for eq:red and eq:green,
either one should satisfy the condition.
Thanks


(Alexander Reelsen) #2

use painless and a script condition and just combine your conditions with &&

"script" : "return ctx.payload.status == 'red' && ctx.payload.foo == 'bar'"

(system) #3

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