I am using elasticsearch date histogram aggregation on @timestamp field. This is part of the query:
'stats': {
'date_histogram': {
'field': '@timestamp',
'interval': '1h',
'format': 'yyyy-MM-dd H:m:s'
}
}
and mapping of the @timestamp:
"@timestamp": {
"type": "date"
}
My time interval is 1h. But I also need to extract minute information from timestamp without performing aggregation on 1m. I tried to specify format of the string representation of the key. I got following output:
'key_as_string': '2020-11-07 10:0:0'
'key': 1604743200000
Is there are way to include minutes in the aggregation results? Either in key or key_as_string?
One @timestamp example indexed in es:
'@timestamp': '2020-12-09T13:50:46.056000Z'