Elasticsearch 5.x date range 查询


{
    "size": 0,
    "query": {
        "match": {
            "appName": "zis-search-za-search-service.prd.za-tech.net"
        }
    },
    "aggs": {
        "range": {
            "date_range": {
                "field": "time",
                "format": "yyyy-MM-dd HH:mm:ss",
                "time_zone": "+08:00",
                "ranges": [
                    {
                        "from": "now-2m"
                    }
                ]
            },
            "aggs": {
                "sum_request_length": {
                    "sum": {
                        "field": "request_length"
                    }
                }
            }
        }
    }
}





你可能感兴趣的:(Elasticsearch 5.x date range 查询)