Mathematical formula

Dear colleagues.
i` have amount of data as float or integer type.
But i search how to recalculate some values with some special formula - could you recommend some method for this solution ? Is the some to use some plugin or script ?

Hello,

what kind of formula is it? Can you give some details?

one simple example for log i have :
date1 , val1, val2.
date2 , val11, val22.

i have to calculate for each log (v1/v2) *100 like below for use in the visualization new result from calculation
date1 , val1, val2, (val1/val2)*100
date2 , val11, val22 , (val11/val22)*100

i know median average ... but it is not the case - i need more flexible calculation (see above example).
Could you help me to find some method to recalculate my values

Kibana does not provide that kind of operations.

As I understand, date1, val1, val2 are in the same event and date2, val11, val22 are in another event.

The kind of operation you want to do can be done by a logstash filter: ruby

Thank you for responce!
but what about elasticsearch does it can calculate by formula for kibana like i need ?

I don't understand. Are you asking if Elasticsearch is the one doing the math? By the way, are you using Logstash to inject your date into your ES database?

yes maybe Elasticsearch can do calculation as i need for kibana.
to inject date into ES database i use the fluentd.

I don't know for ES. As I logstash, I haven't thought of it.
Quickly searching it ES reference, I found those to pages that may interest you:
scripted metric aggregation and pipeline aggregations

If this does not match what you want to do or if you have a problem implementing it, I suggest you on the ES part of the forum where someone will probably be able to help you with this since it seems to be more like an ES question.

ok. so my question re kibana
in case in database ES appear some new field (based on result of formula) - kibana will detect new field automatically for use in visualization ?

I suppose. If it is in the index you set up in your kibana. Kibana looks into ES database and allows you to visualize any field of it (except if the fields are metadata fields). So if you add in it your base, you will see it in Kibana.

ok. thank you for help
i`ll continue my search in ES topic

You're welcome :slight_smile:

I hope this helped you a little

1 Like

Where you able to work this out? I would suggest developing a simple custom visualization that calculates this number. I have already done something very similar.

Let me know if I can be of help.

PS: Check out some of my work at https://github.com/JuanCarniglia.

1 Like

Hi. i`m ready . what do you mean ?

I was only wondering if you were able to finally work this problem out.

Do you still need help on this?

actually yes

I think that you could use a scripted field for this, have you looked into this solution?

yes, i did . i tried. but not deep this time it`s not clear for me how can i use it.