2016-02-25 06:29 AM
Hi I am trying to crate a rule which will fire an alert once 3+ events for a single host is detected within 4hr span. Instead It keeps firing every 3rd event from the host. I am trying the below syntax.
@RSAAlert (oneInSeconds=0, identifiers={"alias_host"})
SELECT * FROM
Event(
(
medium = 32
AND
device_type='entercept'
AND
alias_host IS NOT NULL
)
).win:time(14400 sec)
match_recognize(
partition by alias_host
measures A as a
pattern (A A A A+)
define
A as A.alias_host IS NOT NULL
);
Can I please get the proper syntax or some suggestions to get it done? Thanks in advance.
2016-02-25 10:56 AM
2016-02-25 10:06 AM
Hello
I'd try your rule out on the Epser Try Out page here:
In the EPL Box enter the following:
create schema Event(medium int,device_type string,alias_host string);
@Name('Out') select * from Event;
@Name('MyAlert' )SELECT * FROM
Event(
(
medium = 32
AND
device_type='entercept'
AND
alias_host IS NOT NULL
)
).win:time(14400 sec)
match_recognize(
partition by alias_host
measures A as a
pattern (A A A A+)
define
A as A.alias_host IS NOT NULL
);
In the Enter Sequence of Events, enter:
Event={medium=32,device_type='entercept',alias_host='a'}
t=t.plus(5 seconds)
Event={medium=32,device_type='entercept',alias_host='a'}
t=t.plus(5 seconds)
Event={medium=32,device_type='entercept',alias_host='a'}
t=t.plus(5 seconds)
Event={medium=32,device_type='entercept',alias_host='a'}
t=t.plus(5 seconds)
Event={medium=32,device_type='entercept',alias_host='a'}
t=t.plus(5 seconds)
I tried this and your syntax looks correct in that the alert will fire on the fourth alert:
At: 2001-01-01 08:00:20.000
For me your alert will fire every four events.
When do you not want the alert to fire - eg is this only after 4 matches and then it should remain quiet for a period of time?
2016-02-25 10:56 AM
2016-03-03 08:48 AM
Hi David,
Thanks for the reply and EPL Online Link. I want the alert to be fired once in 4 hours when there are more than 3 matches. It should remain quiet for the next 4 hours. If there are any matches after 4 hours since the first alert,another alert is to be fired.
Regards,
Mathews
2016-03-03 08:49 AM
Thanks David. And sorry for the late reply.