【发布时间】:2014-10-11 23:56:22
【问题描述】:
我很难使用 Kibana 和 Python pyes 库查询 Elastic Search。
https://pyes.readthedocs.org/en/latest/index.html
我需要获取某个field在时间范围内过滤的所有数据。
假设我想在2014-08-17 20:00:00 和2014-08-17 21:00:00 之间的时间范围内通过字段_customer_id 获取所有数据。这是我的开始,但不知道下一步该做什么。
import pyes
from pyes.query import FilteredQuery, MatchAllQuery, BoolQuery, TermQuery
conn = pyes.ES(['87.878.787:9200'])
q = TermQuery("@timestamp", "[2014-08-17T20:00:00 TO 2014-08-17T21:00:00]")
results = conn.search(query = q)
【问题讨论】:
标签: python lucene elasticsearch logstash kibana