Defining ranges but NOT one at a time

I want to create a bar graph of the time a cellular network was down. The y-axis gives the number of times and the x-axis is a set of ranges, 0-100 seconds, 100-200, seconds, in intervals of 100 seconds up to 100000. That's 1000 buckets. I can do this by writing 1000 copies of the range script. AGONY!!!

Is there a way to specify a range as something like:

from 0 to 100000 in groups of 100?

Maybe a histogram does the trick, with interval set to 100? Histogram aggregation | Elasticsearch Guide [8.6] | Elastic

Thanks! That is what I need. I still can't get the visualization to work, however. I wanted intervals of 100 but on the x-axis the intervals are in units of 3000 and goes well out beyond 200000. Only the first few bins have values with 95% of them in the first bin. Can't get the display to change regardless of what I enter for parameters. Put in 10, 100, 1000, 10000 same result. If I select show empty bins I get a min an max option but it does not matter what I enter for those parameters. The graph is always the same. But the HISTOGRAM is exactly what I was looking for.

I found the problem. I had one freak document with a value that was well above 250000. I could use the min-max to exclude that document.

By the way, is there a way to get the actual code used by Kibana when you use their tools to create visualizations? That would be a great help in learning the syntax and seeing what does what. I can get the code of the discovery filtering and am able to create my own filters. I see I can enter JSON in the visualization 'advanced' option. Would love to get the JSON of what I created through the interface!!!

Use the inspect button, inside a Lens visualisation..

Thanks again - just what the doctor ordered!

1 Like

You can ignore most of the stuff inside that inspector. Focus on aggs and query :slight_smile:

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