gpt4 book ai didi

time - Elasticsearch-在线用户数

转载 作者:行者123 更新时间:2023-12-03 00:28:46 25 4
gpt4 key购买 nike

我有一个有关我的用户的数据,表示每个用户何时登录和注销。

我想使用ElasticSearch查询特定间隔(分钟,小时,...)中的用户总数。有谁知道如何获得这种查询?

最好的祝福。

最佳答案

最简单的方法是存储代表每个用户的停留时间的文档-登录和注销时间的时间戳,以及代表停留时间的值(例如,以毫秒为单位)。然后,它变得 super 容易查询。

我个人可能只是将此信息输出到日志,并使用logstash将其铲入Elasticsearch

在此处查看有关两者的讨论:http://www.elasticsearch.org/blog/logging-elasticsearch-events-with-logstash-and-elasticsearch/

关于time - Elasticsearch-在线用户数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19580961/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com