UGA Boxxx

つぶやきの延長のつもりで、知ったこと思ったこと書いてます

【Elasticsearch】日付ごとの集計値を出す

あるアプリの処理実行時間をstartDateTimeフィールドに格納している

このstartDateTimeフィールドを使って日付毎の集計値を出したい

Date histogram aggregationedit を使う

www.elastic.co

{
    "size": 0,
    "aggs": {
        "histogram_daily": {
            "date_histogram": {
                "field": "startDateTime",
                "interval": "1d"
            }
        }
    }
}