# TSVB Table Sorted by timestamp

**URL:** <https://discuss.elastic.co/t/tsvb-table-sorted-by-timestamp/267271>\
**Category:** Kibana\
**Created:** [March 15, 2021, 2:01pm UTC](https://discuss.elastic.co/t/tsvb-table-sorted-by-timestamp/267271 "2021-03-15T14:01:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lamp123432](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@lamp123432](https://discuss.elastic.co/u/lamp123432)\
**Post date:** [March 15, 2021, 2:01pm UTC](https://discuss.elastic.co/t/tsvb-table-sorted-by-timestamp/267271/1 "2021-03-15T14:01:06Z")

</div>

Hello,

I have a nice TSVB graph and I'm trying to get a table out of it sorted by timestamp. Should be simple, but it doesn't show any value:

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

I want a time-based table like the other Table graph, but needs to be TSVB because I use Serial Difference.

Any idea? Maybe a painless script that will make it drop any entry with 0.0bit/s value?

---

<div class="post-metadata">

**Author:** ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)\
**Post date:** [March 22, 2021, 7:02am UTC](https://discuss.elastic.co/t/tsvb-table-sorted-by-timestamp/267271/2 "2021-03-22T07:02:42Z")

</div>

Hey @lamp123432, TSVB table uses a terms aggregation to group the data. You can use datatable visualization instead that also supports serial diff aggregation and date histogram to group the data. For example here

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/f/ef787f2f865a369bbd49618499fe8d5d0a5f4b31.png)  
I have used a date histogram for the bucket aggregation and serial diff as a metric to an average aggregation.

---

<div class="post-metadata">

**Author:** ![lamp123432](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@lamp123432](https://discuss.elastic.co/u/lamp123432)\
**Post date:** [March 22, 2021, 4:00pm UTC](https://discuss.elastic.co/t/tsvb-table-sorted-by-timestamp/267271/3 "2021-03-22T16:00:34Z")

</div>

Great, the only problem is that I use a `Bucket Script` to convert my counters into a rate, as follow:

`(params.bytes * 8) / (params._interval / 1000)`

If I use your method, will I need a scripted field?

TSVB would be best, but grouping by term `timestamp` isn't working : (

Edit: Ok I got it working with a scripted field for the bucket script part, thanks!

---

<div class="post-metadata">

**Author:** ![DougR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dougr/32/48095_2.png) [@DougR](https://discuss.elastic.co/u/DougR)\
**Post date:** [April 14, 2021, 4:32pm UTC](https://discuss.elastic.co/t/tsvb-table-sorted-by-timestamp/267271/4 "2021-04-14T16:32:35Z")

</div>

> [@Stratoula\_Kalafateli](#):
>
> Hey @lamp123432, TSVB table uses a terms aggregation to group the data. You can use datatable visualization instead that also supports serial diff aggregation and date histogram to group the data. For example here

I came to this topic because I was looking for the same functionality, the ability to create a table showing the underlying data for a graph. In my use case, I'm using a TVSB, because my data contains two separate timestamps, and the ability to override the index and specify a separate time field for each allows me to graph the two timestamps as two separate series on the same graph. Unfortunately, I don't have the capability to do this in a data table.

This would be good functionality for this type of visualization. How can I submit a feature request for this?

---

<div class="post-metadata">

**Author:** ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)\
**Post date:** [April 15, 2021, 7:01am UTC](https://discuss.elastic.co/t/tsvb-table-sorted-by-timestamp/267271/5 "2021-04-15T07:01:12Z")

</div>

Hey @DougR!  
You can submit a feature request here [https://github.com/elastic/kibana/issues/new?assignees=&labels=&template=Feature\_request.md](https://github.com/elastic/kibana/issues/new?assignees=&labels=&template=Feature_request.md)

But I am quite sure that you can do this in Lens. Lens offers a more powerful datatable than TSVB.

---

<div class="post-metadata">

**Author:** ![DougR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dougr/32/48095_2.png) [@DougR](https://discuss.elastic.co/u/DougR)\
**Post date:** [April 15, 2021, 1:53pm UTC](https://discuss.elastic.co/t/tsvb-table-sorted-by-timestamp/267271/6 "2021-04-15T13:53:43Z")

</div>

> [@Stratoula\_Kalafateli](#):
>
> You can submit a feature request here [Sign in to GitHub · GitHub](https://github.com/elastic/kibana/issues/new?assignees=&labels=&template=Feature_request.md)

I will submit this, thanks.

> [@Stratoula\_Kalafateli](#):
>
> But I am quite sure that you can do this in Lens. Lens offers a more powerful datatable than TSVB.

If you can, I haven't been able to figure it out. In Lens, for the graphs, you can add layers, which can be from different indices. However, the data table in Lens doesn't appear to allow multiple layers, as far as I can tell. Additionally, in creating the same graph in Lens and in TSVB, TSVB appears to render faster. Finally, in TSVB I can specify the second series from the same index (i.e., `filebeat-*`), but calculate the date histogram buckets with a different timestamp (i.e., use `@timestamp` for one data series, and `log.myapp.second_timestamp` for the second bucket). To do this with Lens, I need to add an alias to the index (i.e., `myapp-second-timestamp`), then create an index pattern with a different timestamp field; this isn't a big issue, but it would be nice to not have to do it.

I'm also reasonably certain I can do this as a Vega visualization, but I'm not wild about learning Yet Another Specification Language (YASL™). 😃

---

<div class="post-metadata">

**Author:** ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)\
**Post date:** [April 15, 2021, 2:27pm UTC](https://discuss.elastic.co/t/tsvb-table-sorted-by-timestamp/267271/7 "2021-04-15T14:27:20Z")

</div>

Oh, now I see what you want to do. Yes, you can't add multiple layers on a Lens datatable. Please submit your feature request in order to track this 🙂

---

<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:** [May 13, 2021, 2:27pm UTC](https://discuss.elastic.co/t/tsvb-table-sorted-by-timestamp/267271/8 "2021-05-13T14:27:39Z")

</div>

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