@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