I need to create a data table which has values that need to be calculated using scripted aggregations.
As Kibana out of box visualization don't support such aggregations(I think), I was considering using Vega visualization for this using the v6.2 Kibana.
However, I am not able to find any documentation for creating data tables in Vega.
Any help would be really appreciated.
Sample query i am trying:
{
  "size": 0,
  "aggs": {
    "locales": {
      "terms": {
        "field": "locale.keyword"
      },
      "aggs": {
        "search_exit": {
          "sum": {
            "field": "Search_Exit"
          }
        },
        "sessions": {
          "value_count": {
            "field": "session_id.keyword"
          }
        },
        "Session_Clickthrough_%": {
          "bucket_script": {
            "buckets_path": {
              "Searches": "search_exit",
              "Sessions": "sessions"
            },
            "script": "params.Searches/params.Sessions*100"
          }
        }
      }
    }
  }
}
In the above case, I would like to create a table with values like:
 Locale          Session_Clickthrough%               Metric_2           Metric_3
 en-US                     10%                        XX                  XX
 zh-cn                     30%                        XX                  XX
Basically, multiple columns calculating percentages need to be shown in a tabular format
Thanks!