How to visualize this query in kibana?

How to visualize this query in kibana?

POST /teletrain/_search
{
  "size": 0,
  "aggs": {
    "orders_per_hour_of_day": {
      "terms": {
        "script": {
          "lang": "painless",
          "source": "doc['ctime'].value.getHour()"
        },
        "size": 24
      },
      "aggs": {
        "total_orders_per_day_of_week": {
          "terms": {
            "script": {
              "lang": "painless",
              "source": "doc['ctime'].value.getDayOfWeekEnum()"
            }
          },
          "aggs": {
            "number_of_weeks": {
              "date_histogram": {
                "field": "ctime",
                "calendar_interval": "week"
              }
            },
            "average_orders_per_hour_day_of_week": {
              "bucket_script": {
                "buckets_path": {
                  "doc_count": "_count",
                  "number_of_weeks": "number_of_weeks._bucket_count"
                },
                "script": "params.doc_count / params.number_of_weeks"
              }
            }
          }
        }
      }
    }
  }
}

Hello,

How did you get this query?

Looks like TSVB | Kibana Guide [master] | Elastic will help you?

Thanks,
Bhavya

Thanks for the information. But I am having difficulties with this part of the request

{
  "size": 0,
  "aggs": {
    "orders_per_hour_of_day": {
      "terms": {
        "script": {
          "lang": "painless",
          "source": "doc['ctime'].value.getHour()"
        }

, I would be very grateful for your help in deciding how to submit this part of the request to TSVB

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.