constantlearner
constantlearner

Reputation: 5247

filtering on multiple conditions spring xd

I want to filter out payload if it contains following error codes 202048 202049 200003

filter --expression=payload.contains('202048')||payload.contains('202049')||payload.contains('200003')

Can i put or condition in my expression || is my or 

Upvotes: 0

Views: 299

Answers (1)

Gary Russell
Gary Russell

Reputation: 174699

See the SpEL language reference.

Use OR (or or).

You need spaces around the or so you need to quote the whole expression; since the module is likely within a string, you will need to escape the literal quotes. For example:

xd:>stream create foo --definition "time | 
    filter --expression='payload.endsWith(\"0\") OR payload.endsWith(\"1\")'| log" --deploy

Upvotes: 1

Related Questions