Bucket script aggregation

Hi,

i was trying also to do something like that inside kibana , that works nice in curl but i saw it's not possible to report it inside Kibana.
as grouping by day of week is not directly possible.

Any idea to do that without this aggr?

thks

one of th other usage i was thinking of is to compare avearge and max value based on day of the week+hour inside this day to compare to current value

{
"size": 0,
"aggs": {
"perday": {
"terms": {
"script": "doc['datedeath'].date.dayOfWeek.value"
}
}
}
}