Hi,
Is it possible to have a count of data of a specific field for the past 7 days?
Query:
GET /my-index/_count?q=my-field:*
Results:
{ "count" : 438, "_shards" : { "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 } }
The above query is showing results for all dates.
Solution found. Hope it manages to help someone out:
GET /my-index/_search { "query": { "bool" : { "must" : { "wildcard" : { "my-field": "*" } }, "filter": { "range": { "@timestamp": { "gte": "now-7d", "lte": "now" } } } } } }
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.