esper A事件逻辑和/或B事件epl

问题描述 投票:0回答:1

要求:1.当A事件和B事件在5秒钟内到达时,输出C事件2.当A事件或B事件到达时,输出C事件

我可以这样写epl:“插入C select * from A.std:lastevent(),B.std:lastevent()”但这不起作用应该怎么办请帮助我,谢谢。

logic esper
1个回答
0
投票

A或B:

select * from A#lastevent as a full outer join B#lastevent as b

让A和B完成,这取决于“ 5秒内到达”的真正含义。这里使用带有内部联接的“#lastevent#time(5)”来使最后一个事件不早于5秒:

select * from A#lastevent#time(5) as a, B#lastevent#time(5) as b

[请澄清“ 5秒内到达”。而是样本模式:

select * from pattern[every a=A -> b=B where timer:within(5)]

输出事件具有两列“ a”和“ b”。

© www.soinside.com 2019 - 2024. All rights reserved.