Elastic 7.9.2 / kibana 7.9.2 pie chart, json filter pb refresh display

Hello,
i work on migration dashboard, vizualisation, queries, kibana 4.5.2 to
7.9.2

I created simple pie chart 7.9.2, with filter with kql, working fine, result is ok.

i create new pie chart 7.9.2, same approach at first one, but i use advanced feature filter json input instead of kql, i copy the filter aggregation and it must be merge with query/filter at execution. it do that well.

The query work fine and get same result response when i compare the two pie chart 7.9.2, and 4.5.2 work fine. i check also the query generated with postman, i have no issue.

But the problem, in case of using json aggregation filter (slice ), the pie chart doesn't refresh graphic in 7.9.2. i have no error wtih the query. The display is stayed with the count with total document, json filter doenst have effect on visualization after query execution

I have not this problem with kibana 4.5.2 when i use json filter aggregation pie chart.

somebody have an idea ? bug ? fixe ?

Thanks alot

kibana pie chart with kql

 "aggregations": {
    "2": {
      "buckets": {
        "CB": {
          "1": {
            "value": 0
          },
          "doc_count": 0
        },
        "GR": {
          "1": {
            "value": 121
          },
          "doc_count": 5439
        },
        "MA": {
          "1": {
            "value": 0
          },
          "doc_count": 0
        },
        "VI": {
          "1": {
            "value": 10
          },
          "doc_count": 1097
        }
      }
    }
 }

piechart-filterkql

kibana pie chart with filter json input, must be identical with the first piechart, i reuse the filter aggregation code of the first query.

piechartwithjsonfilterinput

response result query after filter aggregation merging snipet, querie work fine

    "aggregations": {
        "2": {
          "buckets": {
            "JsonFilter": {
              "1": {
                "value": 173
              },
              "doc_count": 11432
            },
            "brands.code.keyword:\"CB\"": {
              "1": {
                "value": 0
              },
              "doc_count": 0
            },
            "brands.code.keyword:\"MA\"": {
              "1": {
                "value": 0
              },
              "doc_count": 0
            },
            "brands.code.keyword:\"GR\"": {
              "1": {
                "value": 121
              },
              "doc_count": 5439
            },
            "brands.code.keyword:\"VI\"": {
              "1": {
                "value": 10
              },
              "doc_count": 1097
            }
          }
    }

display pie chart doen't work with json filter input aggregation with kibana 7.9.2, work only with kibana 4.5.2 for this case

if someone have one good example of piechart with json input.

My conclusion, the querie merge correctly the filter json input aggregation and the response result is correct, but the display of pie chart take in account only the filter kql. seem to be a bug. the same way work fine with kibana 4.5.2

sample below, when i take the same way as kibana 4.5.2,i got same issue in 7.9.2 like the first exemple , filter aggregation execution work fine but the display doesnt care about result from json input filter. May be take in account only the first bucket "*" added by generated query from response.

{

"filters":{
	"GR":{"terms":{"brands.code.keyword":["TOTAL_GR","GR"]}},
	"VI":{"terms":{"brands.code.keyword":["VISA","VI"]}},
	"MA":{"terms":{"brands.code.keyword":["MASTERCARD","CA"]}},
	"CB":{"term":{"brands.code.keyword":"CB"}}
	}
}
response
{
  "took": 6,
  "timed_out": false,
  "_shards": {
    "total": 2,
    "successful": 2,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 11434,
    "max_score": null,
    "hits": []
  },
  "aggregations": {
    "2": {
      "buckets": {
        "*": {
          "1": {
            "value": 173
          },
          "doc_count": 11434
        },
        "CB": {
          "1": {
            "value": 0
          },
          "doc_count": 0
        },
        "MASTERCARD": {
          "1": {
            "value": 2
          },
          "doc_count": 218
        },
        "TOTAL GR": {
          "1": {
            "value": 121
          },
          "doc_count": 5441
        },
        "VISA": {
          "1": {
            "value": 10
          },
          "doc_count": 1097
        }
      }
    }
  }


i must find a way for disabling only the first search filter kql field and give priority to the json input filter with kibana 7.9.2

kibana 4.5.2 json filter input on filter

Why do you try to use JSON input to define the filters? They look pretty basic so you should be able to define regular filters using KQL just fine.

In general, the advanced JSON input is not intended to be used like this and it was never explicitly supported. If you have very special requirements to build the query which is not supported by the Visualize UI, it's recommended to use the Vega integration instead.

Hello,

Thanks a lot for your answer :slight_smile:

i show only a ligth case for basic undestanding, rework dashboard, visualization is costing much more time for developpers team instead of just a simple copy/past after refactor, but seem to be a bug kibana 7.9 regression vs kibana 4.5.2.

For the moment i use kql, but getting possible limitation. the json input filter was interessting for solving complexe filter aggregation, but if the visualization doesn't care any more about the result, this feature become useless in 7.9. it was not a good surprise and cost lot of time for understand why. may be we can look for another product with elastic connector for complexe dashboards, we will see.

I will look vega if that help in my case.

many thanks.

KR
jp

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