首页 > 解决方案 > 如何在 Elasticsearch / Kibana 数据表可视化中将对象(嵌套)拆分为多列

问题描述

我有一个在 elasticsearch (7.10) 中索引的嵌套对象,我需要使用 kibana 表对其进行可视化。问题是 kibana 会在一列中输入嵌套字段中具有相同名称的值。

部分索引:

{
  "index" : {
    "mappings" : {
      "properties" : {
        "data1" : {
          "type" : "keyword"
        },
        "Details" : {
          "type" : "nested",
          "properties" : {
            "Amount" : {
              "type" : "float"
            },
            "Currency" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "DetailType" : {
              "type" : "keyword"
            },
            "Price" : {
              "type" : "float"
            },
            "Quantity" : {
              "type" : "float"
            },
            "TotalAmount" : {
              "type" : "float"
             .......

表中的问题:

在此处输入图像描述

如何获得三个名为 Details 的行,每行都有一个拆分项(例如 DetailType:“start_fee”)?

更新:我可以在控制台中查询嵌套对象:

GET _search
{
  "query": {
    "nested": {
      "path": "Details",
      "query": {
       "bool": {
       "must": [
        { "match": { "Details.DetailType": "energybased_fee"   }}

      ]
    }
  },
  "inner_hits": {
}
}}}

但是我怎样才能在表格中只看到“inner_hits”值呢?

标签: elasticsearchkibana

解决方案


推荐阅读