Pie chart query

hii All,

I want to show only one value in tags.keyword for example “kie”, however, my tags have 2 value: “kie”, “fluent_log”. how to remove it?

if I click “fluent_log” I still see the value and percentages of it

and there are a lot problem with logic wen we use pie chart
for example, we have tags with 3 value

then we click one in values for example “fluent_log”

the value changed, why???

What do you mean changed ? Can you show es query and response? Does the pie chart display the ES response incorrectly?

I am using grafana v4.6, Elasticsearch Data source.

The value here on the right of pie chart (Total, percentages).
you can see before click “fluent_log” the value of “Kie”, “fluent_log” and “MITO_kie” are differents after click

I think the main problems here is, tags is an array, so when we show tags, we so all values in array

I dont see any values change in your screenshots.

you group by the tags property, elasticsearch does the group for each value

In the first picture:
total percentage
fluent_log 1976 50%
MITO_kie 1730 43.78%
kie 246 6.22%

after click fluent_log
total percentage
kie 1976 50%
fluent_log 1730 43.78%
MITO_kie 246 6.22%

So the value of fluent_log become the value of kie
the value of kie become the value of MITO_kie
and the value of MITO_kie become the value od fluent_log

it is big problems with logic??? Why??’

are you using latest version of pie chart

I am using pie chart version 1.2.0

I test with other issues, they have the same problem
before click value

after click value

So ** the value of containers exchanged**

To fix - Metrics Tab - Query - Group By - change your “Order by: Term Value” to “Order by: Doc Count”.

Thank Davewaters so much, it work well with value new now,
so go back on my question with tags (tags is an array, how to call a single value in array)
I have two indexes:
1.*container-kie in this index tags.keyword has fluent_log and kie
2. *integration framework in this index tags.keyword had fluent_log and integration-framework

so we can see fluent_log in both indexes so it is account to 50%

if we use query NOT tags.keyword:fluent_log it means we move all values of tags in th indexes

so how to remove fluent_log in tags on grafana, (tags is an array, how to call a single value in array)

Put an AND before NOT:

_index:$index AND NOT tags.keyword:fluent_log

Hi, it is not result.

Happy to help, but could you be more explicit? adding the AND NOT is the correct format, but if your result is not what you expect, then there likely is something else causing the issue. Perhaps you could provide the results of the query inspector?

The issue here every tags has value kie has value fluent_log
And every tags has value MITO_kie has value fluent_log
So when we chose AND NOT tags.keyword:fluent_log they will remove all this log/event

I am not clear on your last statement. Elasticsearch indexes each value of an array separately, so they can be searched separately. Can you provide more data, such as example of at least two Elasticsearch documents, and your actual query (from the query inspector) and your expected result?

hii Davewaters,
before

after … AND NOT tags.keyword:fluent_log

The issue here every tags has both kie and fluent_log
And every tags has value MITO_kie also has value fluent_log
So when we chose AND NOT tags.keyword:fluent_log they will remove all this log/event

hii Davewaters, this solution will good for Elasticsearch Data source

however, with MySQL, Zabbix, InfluxDB, prometheus… data source, what should we do?

Sorry - I don’t have MySQL data sources so I am uncertain how to address it - perhaps someone else can comment?

thank you so much, Davewaters