The requested URL was not found on this server. 不管你信不信,反正我是没找到

es2.1 求救: 查新增记录、留存

Elasticsearch | 作者 elk_test | 发布于2017年05月16日 | 阅读数:5204

查询出指定条件的数据,然后根据数据里面的字段id排除不在指定时间范围的数据中。
业务背景:用户每次请求都会有一个设备Id、时间记录,我需要查询出当日新增的用户(也就是今天出现的设备id没有出现在今日之前的记录中)。
SQL:
SELECT *
FROM logstash*
where request_act = 'xxx'
and request_domain = 'xxx'
and request_device = 'xxx'
and request_appname = 'xxx'
and request_begints >= 1494604800
and request_begints < 1494691200
and request_id not in (
select distinct request_id
from logstash*
where request_act = 'xxx'
and request_domain = 'xxx'
and request_device = 'xxx'
and request_appname = 'xxx'
and request_begints < 1494604800
)
求教怎么写这个DSL请求
QQ20170516-0.png
已邀请:

要回复问题请先登录注册