How to create a visualization for this scenario

I have a scenario where I wanted to create a widget of top 5 high priority tickets where each
ticket can have multiple events and a same event can be mapped to a ticket more than once. And if a same event is mapped to a ticket more than once it has to take that as a single count. For eg i have a ticket T1 with events E1,E1 and E2 then the count has to be 2 not 3

{
"size": 0,

"aggs": {
	"sortByPriority": {
		"terms": {
			"field": "priority.keyword",
			"order": {
				"_key": "asc"
			}

		},

		"aggs": {
			"sortByTime": {
				"terms": {
					"field": "dateTime",
					"order": {
						"_key": "desc"
					}
				},
				"aggs": {
					"ticket": {
						"terms": {
							"field": "ticketId.keyword"

						},
						"aggs": {
							"eventByTicket": {
								"terms": {
									"field": "_id"

								},
								"aggs": {
									"top_sales_hits": {
										"top_hits": {

											"_source": {
												"includes": ["eventId", "priority", "dateTime"]
											}

										}
									}
								}
							}
						}
					}

				}
			}
		}
	}
}

}

I need to create a donut chart for the same in kibana visualization

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