Pie chart of element count of an array

Hi,

I'm indexing a documents that can look like this:

{
	"ProcessID": "id1",
	"ErrorList": [{
			"ErrorCode": 123,
			"Time": "2020-01-01T12:23:45"
		},
		{
			"ErrorCode": 123,
			"Time": "2020-01-01T12:44:00"
		},
		{
			"ErrorCode": 456,
			"Time": "2020-01-01T13:23:45"
		}
	]
}

I would like to create a pie chart that is split by ErrorCode. In this case:
ErrorCode 123 66 % or count of 2
ErrorCode 456 33 % or count of 1
How can I do that? When I tried with dynamic mapping, the pie chart only report count 1.

I read https://stackoverflow.com/questions/55503625/how-to-use-elasticsearch-nested-aggregations-in-kibana-visualizations that I should use nested type, is that correct? and then use Vega chart to display the result.

Thanks!

Yes, it sounds like you probably want to use the nested field type for ErrorList. I'm not sure how many visualizations are available for nested fields, but Vega is very flexible so that sounds like a good route to go down.

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