# Create visualization (table with latest deploys for each environment)

**URL:** <https://discuss.elastic.co/t/create-visualization-table-with-latest-deploys-for-each-environment/220213>\
**Category:** Kibana\
**Created:** [February 20, 2020, 3:01pm UTC](https://discuss.elastic.co/t/create-visualization-table-with-latest-deploys-for-each-environment/220213 "2020-02-20T15:01:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Oceans](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_oceans/32/51452_2.png) [@David\_Oceans](https://discuss.elastic.co/u/David_Oceans)\
**Post date:** [February 20, 2020, 3:01pm UTC](https://discuss.elastic.co/t/create-visualization-table-with-latest-deploys-for-each-environment/220213/1 "2020-02-20T15:01:28Z")

</div>

Hi,

I'm trying to create a table with this 5 "simple" fields  
**service\_name | current\_version\_stage | date\_deployed\_stage | current\_version\_prod | date\_deployed\_prod**

The idea is only show one row by service\_name (so don't repeat service\_names) and the lastest information for each environment but in the same row if its possible.

In each deploy I'm inserting this information. This is one of my documents

```
{
  "_index": "deploys",
  "_type": "type",
  "_id": "a37d38066402276c153b823ee0ef8687",
  "_version": 1,
  "_score": null,
  "_source": {
"app_name": "svc-contacts",
"language": "java",
"deployed_by": "Tom Becker",
"environment": "production",
"pipeline_status": "0",
"version": "1.1.2-SNAPSHOT",
"date": "2020-02-20T13:52:12"
  },
  "fields": {
"date": [
  "2020-02-20T13:52:12.000Z"
]
  },
  "sort": [
1582206732000
  ]
}

```

It's possible? how I can achieve it? I was trying with "Top hit" but I can't.

I need some help

Thank you very much

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [February 24, 2020, 11:22pm UTC](https://discuss.elastic.co/t/create-visualization-table-with-latest-deploys-for-each-environment/220213/2 "2020-02-24T23:22:09Z")

</div>

The way to query Elasticsearch for these aggregations provides data for us in a hierarchical manner, where top-level groups have data organized under them that is all relevant to that group. Kibana takes the hierarchy and arranges it into a table. We can summarize the data for us the way that's required, but it comes back with environments as the top level of the data hierarchies, and Kibana will render it in a likewise manner.

I would start by defining the buckets for environment types. That's under Buckets \> Add \> Split Rows. Choose "terms" as the aggregation type, and choose "environment" as the field to split by.

Then you can add a column for service name, by going up to Metrics \> Add \> Metric. Choose "Top Hit" as the aggregation type, and choose additional columns as needed for version and app name. You can delete the "Metric: Count" column that is included by default if you wish.

The result would look something like this:

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

---

<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:** [March 23, 2020, 11:24pm UTC](https://discuss.elastic.co/t/create-visualization-table-with-latest-deploys-for-each-environment/220213/3 "2020-03-23T23:24:58Z")

</div>

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