0
我试图执行elasticsearch查询作为POST
请求,以便从我创建的索引中提取数据。索引中的数据是来自MySQL DB的表格,通过logstash
配置。我如何在我的elasticsearch查询中追加时间戳范围?
这里是我的要求和JSON
体:
http://localhost:9200/response_summary/_search
身体:
{
"query": {
"query_string": {
"query": "transactionoperationstatus:\"charged\" AND api:\"payment\" AND operatorid:\"XL\" AND userid:*test AND time:\"2015-05-27*\" AND responsecode:(200+201)"
}
},
"aggs": {
"total": {
"terms": {
"field": "userid"
},
"aggs": {
"total": {
"sum": {
"script": "Double.parseDouble(doc['chargeamount'].value)"
}
}
}
}
}
}
在上面JSON
身体,我需要我的timestamp
追加到query_string
在在日期范围内从索引获取数据。我尝试添加在查询作为结束:
AND timestamp:[2015-05-27T00:00:00.128Z+TO+2015-05-27T23:59:59.128Z]"
我要去哪里错了?任何帮助,将不胜感激。
感谢它的工作。 :) – Kulasangar
很酷。同时删除'(200 + 201)'中的'+' – Val