0

Does siddhi (http://siddhi-cep.blogspot.com/) / WSO2 have the functionality to work on query similar to

1) 5 error followed by success

2) 5 error followed by 5 fatal followed by 1 success

time window can by assumed to be present

could anyone provide with an example?

sabbir
  • 686
  • 1
  • 9
  • 15

2 Answers2

0

You can achieve this task using the pattern or sequence implementation of siddhi (pattern & sequence are two different implementations please refer the doc)... please refer [1] & [2]...

[1] http://docs.wso2.org/wiki/display/CEP210/Patterns

[2] http://docs.wso2.org/wiki/display/CEP210/Sequences

@ DarkCthulhu : Siddhi is the query processing engine of the WSO2 CEP... (for more info about this please refer : http://docs.wso2.org/wiki/display/CEP210/Introduction+to+SiddhiQL)

Thanks,

Mohan

Mohanadarshan
  • 830
  • 5
  • 5
  • thanks. One more question. Can we apply Pattern.count(...) to count based on some fields? like 5 errors for same ip? – sabbir Apr 23 '13 at 04:15
0

@Sabbir:

Regarding your query about whether we can apply Pattern.count(...), are you asking whether it would be possible to apply aggregates like count, avg, max,min, sum on the fields that were matched by a pattern?

If so, the answer is no, it is not possible with the current version of Siddhi.

If what you want is to simply count the no. of errors for a given ip you can try a query like this.

from NetFlowStream[status == 'ERROR']#window.time(5 min) 
insert into ErrorNetFlow ipAddr, count(ipAddr) as ipAddrCount
group by ipAddr

You can refer to http://docs.wso2.org/wiki/display/CEP210/Windows for more information on writing window queries for Siddhi.

Thanks,

Lasantha

lasantha
  • 686
  • 5
  • 10