Hi,

Assume following row data set is persisted in DAS for stream definition of
eventId , userName, authSuccess .

1,user1,true
1,user1,true
2,user1,true
3,user2,true
3,user2,true
3,user2,true
4,user3,true
4,user3,true
5,user3,true
6,user3,true


I need to query above data set and get per user success count for a given
time period. Since we have duplicate event ids we need to group by eventid
first and then group by username.Assume above data range is for a specific
time period. Final result I need is below which has two fields username and
authSuccessCount.

user1 , 2
user2 , 1
user3 , 3

I can follow below type of query to group by using one field by making the
eventId a Facet.

{
                tableName : "AUTHENTICATIONANALYTICSSTREAM",
                groupByField:"eventId",
                query  : "timestamp:[" + startTimeStamp + " TO " +
endTimeStamp + "] AND authenticationSuccess:True",
                NoOfRecords : 1000000,
                aggregateFields : [
                    {
                        fieldName:"eventId",
                        aggregate:"COUNT",
                        alias:"AuthSuccess_Sum"
                    }
                ]
            }

How can we have multiple grouping functionality to achieve above ?

Thanks,
Damith.




-- 
Software Engineer
WSO2 Inc.; http://wso2.com
<http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
lean.enterprise.middleware

mobile: *+94728671315*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to