Help creating 'Time since last logged-in' chart

Hi Elasticsearch community,

I've got a requirement to display a time since last logged-in chart where the output is to be:
Y axis: count of user_id's having logged in between a specific time group
X axis: specific date group differences such as 3 days, 10 days, 15 days, 30 days, 3 months, 3+ months.

Every time a user is logged in, we have a row stored with the additional fields { "user_id" : user_id, "sign_in_status" : "success" }. There is a timestamp for each row created.

In terms of the date differences groupings: I've tried using a date-range @timestamp with now-3d, now-10d, now-15d, now-1m, now-3m which is the closest I feel I've been.
My Y-axis is doing a count
My X-axis is aggregating @fields.data.user_id.keyword with a Metric:Count

Any help would be greatly appreciated,
Thank you

Sounds like what you've got is exactly what you need... The only thing that seems missing is a filter, which you can add in "add a filter", then select "sign_in_status", then "is", then "success".

Thank you Lukas, this helped a lot.

I ended up having to change the y-axis to a unique count of user_id's and a date range on the @timestamp field for the x-axis and divided the timestamps into 6 date range groups.

Cheers,

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.