# Kibana Time Series Visualization: group fields by values of another field

**URL:** https://discuss.elastic.co/t/kibana-time-series-visualization-group-fields-by-values-of-another-field/318048
**Category:** Kibana
**Created:** [November 2, 2022, 8:12pm UTC](https://discuss.elastic.co/t/kibana-time-series-visualization-group-fields-by-values-of-another-field/318048 "2022-11-02T20:12:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bgyomorei\_c](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@bgyomorei\_c](https://discuss.elastic.co/u/bgyomorei_c)
#### Post date: [November 2, 2022, 8:12pm UTC](https://discuss.elastic.co/t/kibana-time-series-visualization-group-fields-by-values-of-another-field/318048/1 "2022-11-02T20:12:34Z")

</div>

Hi,

**Context** :  
we have performance testing data coming from JMeter and from multiple test machines/hosts as well. So we've added a _jmeter\_host\_id_ field to all of our samples to be able to distinguish inbetween these.

**Goal** :  
I'd like to create a dashboard where different aggregation of the response time, like: average, 95pct, maximum are all visible in one panel and also grouped by the _jmeter\_host\_id_.

**Attempt 1** :  
This is where i started from, no grouping and the legend gets displayed correctly:

 ![Screenshot 2022-11-02 at 18.40.15](https://us1.discourse-cdn.com/elastic/original/3X/0/2/02479639a07366940386a4559651f0b3eefb3ed0.jpeg)

**Attempt 2** :  
Then i tried the **Group by Terms** setup in the TSVB panel. Grouping works, but on the legend the aggregation information is no longer visible. Frankly i'm not completely sure what the **Top** : 10 parameter does here either:

 ![Screenshot 2022-11-02 at 18.48.06](https://us1.discourse-cdn.com/elastic/original/3X/9/1/91acb15c9a8202222efc385b09e488cf5dadf21c.jpeg)

**Attempt 3** :  
This one is a "lens" type panel:

 ![Screenshot 2022-11-02 at 20.55.55](https://us1.discourse-cdn.com/elastic/original/3X/b/d/bdb49936c02ed60d58e10015929e6ee9e1e9c9cb.png)

**Questions** :

1. To me Attempt 2 and 3 look kinda same. Are these the right solutions or is there a better one?
2. The only difference i see in-between A2 and A3 is that the Legend in A2 is messed up. Can this be fixed somehow?
3. What the **Top** parameter in A2 does exactly? Let's say maximum number samples per second could be 15000. If i want to get proper numbers, should i set it to 15000 instead of 10?
4. Kinda the same question for A3, not sure what the **Number of values** parameter does here.

Thank you!

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [November 3, 2022, 4:06pm UTC](https://discuss.elastic.co/t/kibana-time-series-visualization-group-fields-by-values-of-another-field/318048/2 "2022-11-03T16:06:39Z")

</div>

1. That looks to me like the right solution, it might look better if you change you color palette or play with the chart to make it stacked bars or lines.
2. Lens is the way forward in Kibana right now, you can add a bug for TSVB in our Github repo for the labels being messed up, but It might take some time to get a fix.  
3&4. The Top and the Number of Values are the same thing, they represent the number of samples that are taken from each shard in Elasticsearch( it will take the top 10 values of that field from each shard, then combine all the shards and aggregate that data and send it to Kibana). The bigger the number, the more accurate the data is, but at the same time it will be a whole lot more taxing on the performance. 15000 is not a good number. I would say 10-50 is a good start, it all depends on how fragmented the data is.

---

<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: [December 1, 2022, 4:07pm UTC](https://discuss.elastic.co/t/kibana-time-series-visualization-group-fields-by-values-of-another-field/318048/3 "2022-12-01T16:07:31Z")

</div>

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