How to ignore empty values on Bar Chart (displaying percentage)

Hi,

Is there a way to ignore empty values, such that Kibana don't display the Bars (highlighted) for empty values in the screen shot below?

Actually, if on the left I select 'normal' instead of 'percentage', it gives me the desired result i.e plotting only a single bar where some of the values are 'Y', while ignoring the empty values altogether. However as I select 'percentage' it shows me bars for values that dont exists (I think it just divides the bar evenly among all expected fields).

I will appreciate any help in addressing this issue
Thanks

Hi,

You can change the min_doc_count of the field to greater than zero: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html in JSON input under advanced in visualization editor.

That should make sure that Kibana will ignore the empty values.

Thanks,
Bhavya

Should I put the following similar JSON script in Advances Json input? Actually I tried and it dosent show any difference, would you also share an example Json ?

{
    "aggs" : {
        "tags" : {
            "terms" : {
                "field" : "tags",
                "min_doc_count": 10
            }
        }
    }
}

Hi,

Here you go: I ingested logs data from load data into Kibana tutorial( https://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html), created an area chart on count on y-axis and terms on x-axis and gave this value in advanced json: {"min_doc_count":1437}. This basically made the area chart ignore document documents with machine.os as osx.

Without the min_doc_count:

Hope this helps.

Thanks,
Bhavya

Thanks, but I am getting following error, is it supported for 'Filters' ? I am using Filters, where each field has to be considered if its value is 'Y':

Visualize: [parsing_exception] Unknown key for a VALUE_NUMBER in [3]: [min_doc_count]., with { line=1 & col=1437 }

 Less Info
OK
296s
Error: [parsing_exception] Unknown key for a VALUE_NUMBER in [3]: [min_doc_count]., with { line=1 & col=1437 }
    at respond (https://gkibana.clouddqt.capitalone.com/bundles/kibana.bundle.js?v=16588:109:161556)
    at checkRespForFailure (https://gkibana.clouddqt.capitalone.com/bundles/kibana.bundle.js?v=16588:109:160796)
    at https://gkibana.clouddqt.capitalone.com/bundles/kibana.bundle.js?v=16588:103:301134
    at processQueue (https://gkibana.clouddqt.capitalone.com/bundles/vendors.bundle.js?v=16588:35:132456)
    at https://gkibana.clouddqt.capitalone.com/bundles/vendors.bundle.js?v=16588:35:133349
    at Scope.$digest (https://gkibana.clouddqt.capitalone.com/bundles/vendors.bundle.js?v=16588:35:144239)
    at Scope.$apply (https://gkibana.clouddqt.capitalone.com/bundles/vendors.bundle.js?v=16588:35:147018)
    at done (https://gkibana.clouddqt.capitalone.com/bundles/vendors.bundle.js?v=16588:35:100026)
    at completeRequest (https://gkibana.clouddqt.capitalone.com/bundles/vendors.bundle.js?v=16588:35:104697)
    at XMLHttpRequest.xhr.onload (https://gkibana.clouddqt.capitalone.com/bundles/vendors.bundle.js?v=16588:35:105435

ah I don't think so. I am tagging our viz team to see if they have an answer.
@timroes/@ppisljar

Thanks,
Bhavya

Hi,

min_doc_count does not exist on the Filters aggregation and thus cannot be used in this place. I think you are running an older version of Kibana? The wrong behavior of 0 in percentage charts has been fixed via https://github.com/elastic/kibana/pull/15765 for 6.3.0. Upgrading to 6.3 (or better 6.4) will solve that issue.

Cheers,
Tim

Thanks for the clarification, it make sense now.

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