I would like to get the hourly average number of events happened in the last hour. All the events must have the field "DayType" equal to "T1" and the field "Town" equal to "NA".
My basic working query is the following. However, I don't know how to add the filter by the field "DayType" and "Town".
POST /myindex/_search
{
"size": 0,
"aggs": {
"range": {
"date_range": {
"field": "Datetime",
"ranges": [
{
"from": "now-1H/H",
"to": "now/H"
}
]
}
}
}
}