使用逻辑与的锡迪复杂事件处理

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

我正在使用SiddhiQL进行复杂的事件处理。我的用例是检查在15分钟内是否发生了两个带有特定过滤器的特定类型的事件。例如-

If event1[filter 1] and event2[filter 2] within 15 mins
Insert into output stream 

就我而言,这两个事件中的任何一个都可以首先发生,我需要检查在收到第一个事件后是否在15分钟内收到第二个事件。

在SiddhiQL中可能吗?

编辑#1-我在下面定义了我的流和事件(下面的代码不起作用)

define stream RegulatorStream(deviceID long, roomNo int, tempSet double);

@sink(type = 'log', prefix = "LOGGER")
define stream outputStream (roomNo int,rooomNo int);

from e1 = RegulatorStream[roomNo==23] and e2 = RegulatorStream[e1.deviceID == deviceID AND roomNo ==24] within 5 minutes 
select e2.roomNo,123 as rooomNo
insert into outputStream;

在上述情况下,当我在自己的RegulatoryStream中收到具有相同deviceID的任意顺序的5分钟内roomNo = 23 AND roomNo = 24的事件时,我需要发出警报。

如何在SiddhiQL中实现?

wso2 complex-event-processing siddhi wso2cep
1个回答
0
投票

是的,这可以通过Siddhi模式实现。请参阅https://siddhi.io/en/v5.1/docs/query-guide/#pattern中有关Siddhi模式的文档以及https://siddhi.io/en/v5.1/docs/examples/logical-pattern/中的示例。

您可以在模式中使用OR操作来绕过事件发生的顺序。

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