Jose_H
May 28, 2020, 5:49am
#1
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.
Jose_H
May 28, 2020, 12:01pm
#2
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"
}
}
}
}
}
}
1 Like
system
(system)
closed
June 25, 2020, 12:01pm
#3
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.