# Dynamically show columns in a Discover table by wildcard matching

**URL:** <https://discuss.elastic.co/t/dynamically-show-columns-in-a-discover-table-by-wildcard-matching/355477>\
**Category:** Kibana\
**Created:** [March 15, 2024, 11:55am UTC](https://discuss.elastic.co/t/dynamically-show-columns-in-a-discover-table-by-wildcard-matching/355477 "2024-03-15T11:55:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![melkamar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/melkamar/32/100785_2.png) [@melkamar](https://discuss.elastic.co/u/melkamar)\
**Post date:** [March 15, 2024, 11:55am UTC](https://discuss.elastic.co/t/dynamically-show-columns-in-a-discover-table-by-wildcard-matching/355477/1 "2024-03-15T11:55:40Z")

</div>

Hi, I am wondering if Kibana supports my use case. I am creating a dashboard where I want to show app usage metrics data. The individual documents are pretty small (about 5-10 fields). Some of the fields are common to all the documents, but some are context-specific (and new may be added in the future).

To illustrate, this is an example document:

```json
{
  "origin": {
    "inst": "foobar-demo",
    "env": "production"
  },
  "@timestamp": "2024-03-15T13:10:00+02:00",
  "metricPoint": {
    "metricSetName": "assignment_resolved",
    "userId": "5565d66d4809467a458b4567",
    "context": {
      "resolution_type": "done"
    }
  }
}

```

In my dashboard, I want to have a table where all relevant columns are shown. "Relevant columns" means:

- Common fields
  - `origin.inst`
  - `origin.env`
  - `metricPoint.metricSetName`
  - etc...

- "Context-specific" fields:
  - `context.*`

What I want is to show the statically defined columns for "common fields", but then to also show columns for all "context-specific" fields in the matched data. If the data in the selection would contain 10 different `context.*` fields, I would like there to be 10 extra columns.

The idea is that before looking at the columns in the dashboard, the data would be pre-filtered to a lower cardinality and at that point there would not be too many extra columns polluting the table.

* * *

At the moment, what I do is just show the statically defined fields, but when an analyst is interested in more details, they have to expand the document line with the `<->` arrow (screenshot). This is clunky as it does not provide an easy overview of the data.

![image](https://us1.discourse-cdn.com/elastic/original/3X/a/4/a462d42108f2043695cd835a732ae1c76918eef6.png)

An alternative to this that I really want to avoid is having a concrete saved search per each `metricSetName`, which would show the appropriate `context` columns. But there would be dozens of saved searches with more being added on the fly.

* * *

**To sum up** , is there a way I can achieve this?

Without filter:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/6/b677cfafac97fe219138c595edce7708e8770160.png)  
Filtering for just one metric type (notice the disappearing columns which are not contained in any matching document)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/c/bc4837c8dbd78d902911839e63ca9fb90803258a.png)

* * *

Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 12, 2024, 11:56am UTC](https://discuss.elastic.co/t/dynamically-show-columns-in-a-discover-table-by-wildcard-matching/355477/2 "2024-04-12T11:56:21Z")

</div>

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