Count of user who visited 3 days in a row


(Vjyanand) #1

I have elasticsearch documents like {"user":"a","timestamp":1449807786150}. Would like to query users who have timestamp for 3 consecutive days.


(Mark Walkom) #2

Ok, and do you want help with that, or something else.


(Vjyanand) #3

Yes, need help to query the data. What would be the DSL?


(Mark Walkom) #4

Try https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html#ranges-on-dates


(Vjyanand) #5

I understand we can use data range. But I want to get say "number of users who have logged in 3 consecutive days for month of December or number of users who have logged in n consecutive days in the last m days (m is always greater than n)" Thanks


(Vjyanand) #6

Can someone please help me on this? Thanks


(system) #7