I'll try to present my problem on the following sample set:
01.05.11, User=A, Action=X
02.05.11, User=A, Action=X
03.05.11, User=A, Action=X
04.05.11, User=B, Action=X
08.05.11, User=A, Action=X
09.05.11, User=A, Action=X
09.05.11, User=B, Action=X
09.05.11, User=A, Action=X
With 01.05.11 being a Sunday, what we have over two weeks time is:
User A - 1 Action on first and second Sunday, 1 Action on first Monday, 1 Action on first Tuesday, 2 Actions on second Monday
User B - 1 Action on first Wednesday, 1 Action on second Monday
The first step of my search (index="my_index" | bucket span=1d _time | stats count as countActions by User, _time, date_wday | sort User, date_wday) calculates the number of Actions for every date per User and assigns the Weekday of that date. Now I want to calculate the averages.
The result (of averages per user per weekday over two weeks) should be:
A Sunday 1
A Monday 1.5
A Tuesday 0.5
A Wednesday 0
A Thursday 0
A Friday 0
A Saturday 0
B Sunday 0
B Monday 0.5
B Tuesday 0
B Wednesday 0.5
B Thursday 0
B Friday 0
B Saturday 0
How can this be done?
... View more