When I create the pie chart I get a 50/50 percentage that is wrong because in this hit on this field there are 19 passed and 5 failed like the list above. I am slice by the field that contains the list and size by count of record. I am not sure what I am doing wrong. Please help.
List l = new ArrayList();
l.add(doc['ENVA.Login.status.keyword'].value);
l.add(doc['ENVB.Login.status.keyword'].value);
l.add(doc['ENVC.Login.status.keyword'].value);
l.add(doc['ENVD.Login.status.keyword'].value);
return l;
When I create the pie chart I get a 50/50 percentage that is wrong because in this hit on this field there are 23 passed and 1 failed like the list above.
the pie chart is for a single document (identified by id or something) or aggregation of multiple documents?
Terms aggregation count documents. It count the document with 23 passed and one failed as one document for passed and one document for failed. This is the reason for that 50/50 pie chart.
I see, but it is not straight-forward but a difficult problem with elasticsearch.
So you have to take alternatives with some compromise. There are several approaches that are quite different.
As far as I can think of, there are
use logstash split filter plugin to create a new index with new atomic document.
eg
{"ENV": "A", "Login": {"status": "passed"}}
{"ENV": "B", "Login": {"status": "passed"}}
{"ENV": "C", "Login": {"status": "passed"}} ...
This is the structure of documents that kibana is good at, and you can realize various visualizations relatively freely.
create script fields of counting each 'pass' and 'fail' values in LoginListStatus and use "Bar vertical percentage" visualization of lens.
If you click the "Inspect" button on the top right on that chart editor, you should see a table with the data underneath the visualization. What values are expressed there?
Also, in the same panel you can switch from table view to request view to get the actual query sent to the server to compute the table. Can you share that (removing sensitive information)?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.