Finding inactive users from event logs


If we store user-activity event logs in ES, is there a way to query for inactive users?

It is not clear ES allows me to query for "old" documents containing term "X", where there exists no recent documents with the same term "X".

I have seen a blog-post about creating "entity-centic indices" to compute values like "average session duration" from login data events, as basic aggregations and pipelines are not sufficient. But, I would like to understand if a method exists without developing custom code required for the "entity-centric" index approach.