Formula for logs

Dear colleagues.

i have the configuration fluentd, ES, Kibana and amount of data with float and integer values indexed
one simple example for logs i have :
date1 , val1, val2.
date2 , val11, val22.

i have to calculate for each log new value in same database (v1/v2) *100 like below for use in the kibanas visualization this calculated result :

date1 , val1, val2, (val1/val2)*100
date2 , val11, val22 , (val11/val22)*100

i know median average feature of kibana ... but it is not the case for me - i need more flexible calculation (see above example simple formula).
Could you help me to find some method to recalculate my values. Thank you in advance.

Have a look at script fields. (Please don't post the same question multiple times.)

Thank you!
i revised script field - but how to use it for kibana - do you know?
The same question but different systems in detail ....
(as you can see people from another categories can not help ).