尊敬的Elastic Search用户:
我是新手在ElasticSearch。
我不知道如何将下面的sql命令转换成elasticSearch DSL查询?有人能帮助我吗?
SELECT ip, count(*) as c FROM elastic WHERE date
BETWEEN '2016-08-20 00:00:00' and '2016-08-22 13:41:09'
AND service='http' AND destination='10.17.102.1' GROUP BY ip ORDER BY c DESC;
谢谢你
1条答案
按热度按时间9fkzdhlc1#
下面的查询将完全实现您所需的功能,即,它将选择所需
date
范围内的文档以及所需的service
和destination
,然后对它们的ip
字段运行terms
聚合(=group by),并按计数降序对后者进行排序。