How to divide two fields for visualization?

Hello,

I have been experimenting with visualizations and wanted to know if there is a way to divide the value of a field?

I would prefer not to have to write a script. I am looking for a simple "calculation" or "division" option in the tsvb/linechart visualizations but have not been able to find anything.

The closest I have come to success was doing a filter ratio in tsvb but somehow it always returns 0.

Any help is very much appreciated.

This is what I tried in tsvb so far. Maybe someone knows what I am doing wrong?
I want to divide the field index_stats.total.search.query_time_in_millis by the field index_stats.total.search.query_total.

I tried all kinds of values for the numerator/denominator fields, the current input in the picture is not the only thing I tried. I also tried the names of the fields I want to divide.

You can use the math aggregation for this - add a new series, select math as operation, select the values you want to divide (Average of field1, count), give them names and enter the division operation as formula: params.param1 / params.param2:

1 Like

params.param1 / params.param2 is not working for me. Individually I am getting the results. but with divide operator it is showing no data to display.

This only did half the trick. I get the right result now - thank you very much for that - but the values are not updating. Do you know why that is?

Figured it out. I changed the metrics from average to derivative. Now everything updates. Ty.

Can you screenshot your configuration like I did above?

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