Average documents per customer field

I would like to find the average number of times a user has triggered a login event. Our data is organized with an event per login and each event has a user_id field. All I want to do is take the "count" and divide it by "unique". Thought the "average" feature would be able to do this, but seems like it only aggregates on numeric fields. Any other way of doing this?

Add a scripted field that is "1" for login events and "0" for any other events and then Average on that ?

hmm if i'm understanding you correctly, that would give us a value bounded by 1? it would be answering the question "out of all events in this index, how many of them are login events?" .. is my understanding correct ?

the question I would like to be answering is "for every user that triggered a login event, what is the average number of times they logged in?". clearly here the answer wouldn't be bounded by 1.. meaning the average number of times a user logs in could be greater than 1.

Hmm sorry - I didnt read your original question properly. I actually dont think thats possible at the moment.

I think this is what you are looking for - but doesnt seem like its coming soon.