Mathematical formula


(Dmitriy) #1

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 ?


(NoƩmie) #2

Hello,

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


(Dmitriy) #3

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


(NoƩmie) #5

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


(Dmitriy) #6

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


(NoƩmie) #7

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?


(Dmitriy) #8

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


(NoƩmie) #9

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.


(Dmitriy) #10

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 ?


(NoƩmie) #11

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.


(Dmitriy) #12

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


(NoƩmie) #13

You're welcome :slight_smile:

I hope this helped you a little


(Juan Ignacio Carniglia) #14

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.


(Dmitriy) #15

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


(Juan Ignacio Carniglia) #16

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

Do you still need help on this?


(Dmitriy) #17

actually yes


(Juan Ignacio Carniglia) #18

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


(Dmitriy) #19

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


(system) #20