Search code examples
elasticsearchkibana

Available fields are not visible in the Discovery panel


I have some indices where a part of their corresponding template is like this:

enter image description here

when I query the indices in the Dev Tools, I am able to retrieve desired data and see the above fields. For example

enter image description here

you can clearly see that labels.state and labels.pipeline_version are available for this specific document. I can even search for a specific field

enter image description here

But I can't see all fields in the Discover section (for example labels.state)!

enter image description here

enter image description here

Any idea? Thanks!

This is the output of _mapping API

{
  "debug-2022.07.15": {
    "mappings": {
      "dynamic": "true",
      "dynamic_date_formats": [
        "strict_date_optional_time",
        "yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"
      ],
      "dynamic_templates": [],
      "date_detection": true,
      "numeric_detection": false,
      "properties": {
        "@timestamp": {
          "type": "date",
          "format": "strict_date_optional_time"
        },
        "@version": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "event": {
          "properties": {
            "original": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        },
        "host": {
          "properties": {
            "name": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        },
        "labels": {
          "properties": {
            "params": {
              "type": "keyword"
            },
            "parentId": {
              "type": "keyword"
            },
            "pipeline_version": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "run_number": {
              "type": "keyword"
            },
            "scenario": {
              "type": "keyword"
            },
            "scenario_description": {
              "type": "keyword"
            },
            "scenario_detail_params": {
              "type": "keyword"
            },
            "scenario_name": {
              "type": "keyword"
            },
            "state": {
              "type": "keyword"
            },
            "suite_name": {
              "type": "keyword"
            },
            "test_id": {
              "type": "keyword"
            },
            "test_info": {
              "type": "keyword"
            },
            "test_no": {
              "type": "keyword"
            },
            "test_object": {
              "type": "keyword"
            },
            "type": {
              "properties": {
                "keyword": {
                  "type": "keyword"
                }
              }
            },
            "xray_test_description": {
              "type": "keyword"
            },
            "xray_test_execution": {
              "type": "keyword"
            },
            "xray_test_id": {
              "type": "keyword"
            },
            "xray_test_id_summery": {
              "type": "keyword"
            },
            "xray_test_plan_key": {
              "type": "keyword"
            },
            "xray_test_plan_key_summery": {
              "type": "keyword"
            },
            "xray_test_plan_summery": {
              "type": "keyword"
            },
            "xray_test_step_info": {
              "type": "keyword"
            },
            "xray_test_summery": {
              "type": "keyword"
            }
          }
        },
        "log": {
          "properties": {
            "file": {
              "properties": {
                "path": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                }
              }
            }
          }
        },
        "message": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "tags": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        }
      }
    }
  },
  "debug-2022.07.13": {
    "mappings": {
      "dynamic": "true",
      "dynamic_date_formats": [
        "strict_date_optional_time",
        "yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"
      ],
      "dynamic_templates": [],
      "date_detection": true,
      "numeric_detection": false,
      "properties": {
        "@timestamp": {
          "type": "date",
          "format": "strict_date_optional_time"
        },
        "@version": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "error": {
          "properties": {
            "stack_trace": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "type": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        },
        "event": {
          "properties": {
            "original": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        },
        "host": {
          "properties": {
            "name": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        },
        "labels": {
          "properties": {
            "error_level": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "jira_project_key": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "params": {
              "type": "keyword"
            },
            "parentId": {
              "type": "keyword"
            },
            "pipeline_version": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            },
            "run_number": {
              "type": "keyword"
            },
            "scenario": {
              "type": "keyword"
            },
            "scenario_description": {
              "type": "keyword"
            },
            "scenario_detail_params": {
              "type": "keyword"
            },
            "scenario_name": {
              "type": "keyword"
            },
            "state": {
              "type": "keyword"
            },
            "suite_name": {
              "type": "keyword"
            },
            "test_id": {
              "type": "keyword"
            },
            "test_info": {
              "type": "keyword"
            },
            "test_no": {
              "type": "keyword"
            },
            "test_object": {
              "type": "keyword"
            },
            "type": {
              "properties": {
                "keyword": {
                  "type": "keyword"
                }
              }
            },
            "xray_test_description": {
              "type": "keyword"
            },
            "xray_test_execution": {
              "type": "keyword"
            },
            "xray_test_id": {
              "type": "keyword"
            },
            "xray_test_id_summery": {
              "type": "keyword"
            },
            "xray_test_plan_key": {
              "type": "keyword"
            },
            "xray_test_plan_key_summery": {
              "type": "keyword"
            },
            "xray_test_plan_summery": {
              "type": "keyword"
            },
            "xray_test_step_info": {
              "type": "keyword"
            },
            "xray_test_summery": {
              "type": "keyword"
            }
          }
        },
        "log": {
          "properties": {
            "file": {
              "properties": {
                "path": {
                  "type": "text",
                  "fields": {
                    "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                    }
                  }
                }
              }
            }
          }
        },
        "message": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "tags": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        }
      }
    }
  }
}

and my indices

enter image description here


Solution

  • As pointed out here https://github.com/elastic/kibana/issues/136515

    Currently, on Discover page we render only first 500 documents (per discover:sampleSize setting) and field list is built based on this first batch. If fields have empty values in the first 500 documents then by default they won't be listed in the sidebar unless user switches off "Hide empty fields" toggle as here: enter image description here