Show last n records in Kibana ascending order

Hi,

I have docs on ElasticSearch. Each document has idx field. idx field values start from 1. Also all my docs has duration field. They are also number. It can vary from 900 to 1000. I want to visualize last 10 (according to idx) docs' duration with line chart on Kibana.

  • Docs can be inserted anytime. So my total doc count is not fixed.
  • idx increment is 1.
  • if I have 40 docs, x-axis should start from 31 and end with 40. If I have 100 docs x-axis should start from 91 and end with 100, etc...
2 Likes

Hey @Sabri_Mutlucag, we can get pretty close to what you're looking for using a vertical bar chart and a few tricks. Kibana's visualizations are based on aggregates, and they aren't geared around visualizing individual documents. With that being said, since we have the idx field which is a unique value, if we create a terms aggregate using the idx each document will end up in its own bucket.

24%20PM

Thanks for reply @Brandon_Kobel. But it orders x axis value from last/max id to (max-5) id - 1st Image. I want to order from (max-5) id to max - 2nd image.

  • 1st image
    image
  • 2nd image
    image

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