filtering on multiple conditions spring xd

最后都变了- 提交于 2019-12-13 05:18:50

问题


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 

回答1:


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


来源:https://stackoverflow.com/questions/34088075/filtering-on-multiple-conditions-spring-xd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!