Sum values before applying calculation


I try to display a throughput graph over a time period of 7 days.
To do this I need to set Interval in DateHistorogram to 600s.
(Otherwise there are to many events. Kibana will complain)
This will make the result 600 time greater than it should be.

To compensate for this I add formula in JSON input window for Y-axis where I sum the values.
Unfortunately is the calculation done on each event instead of the sum of the time interval.
This makes the result after calculation = 0. And then the sum of 0 is always 0

I wonder if it is possible to first sum all values over a timespan and then apply the calculation?

Br Mathias

You should be able to do this in Timelion or the new Time Series visualization. It's not yet possible in the basic Kibana visualization editor.

Thanks for your answer.

I have tried the new Time Series visualization but I do not know how to make sub aggregation.

I need to aggregate over time.
Then I need to apply a filter.
Then I need to split series to show one line per type.

It seems like after I have made a filter aggregation in the new visual builder I can not make another aggregation.
Or at least I do not know how to do it and no one has been able to answer my question in this forum.

Timelion is too painful to maintain when you have many graphs.

Br Mathias

I don't have the answer off the top of my head, I'll have to ask around. Right now a lot of folks are traveling so it might take a few days, but I'll get back to you. It may be that it's not possible right now and we'll need to file an enhancement request.

Hi Bargs,

Have you been able to find any answer from the experts?

Br Mathias

Instead of creating a filter aggregation in the "group by" section you can use the "panel filter" in the "Panel Options".


I understand what you mean. I add a common filter in Panel Options and the group by Terms in the "Group By" section.
In panel filter I can add a filter common for all timeseries.
That works for time series using the same filter.
Unfortunately I have 4 time series with 4 different filters.

I think new functionality is needed to make Visual Builder complete.
It would be good if adding new groupings could be as easy as it is in Grafana.

Br Mathias

So you want a filter per Series? I’ve been thinking about adding that for the last 2 months, let’s see what happens in the next couple of days :wink:

If you can add this functionality you make me very happy.

Thanks in Advance.

Here is the PR I threaten to write:

Many thanks,

Any plans to tag it with 5.x.y?

Something completely different related to visual builder:
Do you know if it would be easy to add a variable keeping track of used time interval (when time_interval=auto) which could be used in formulas? This would make it possible to select different time span and use kibana's time interval=auto and get the correct result of sum values.

Kind regards

The only things getting back ported to 5.x is bug fixes. I will look into adding the interval to equations. :smiley:

Thanks a lot.

It would simplify things a lot if we make use of an interval variable.

Br Mathias

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