Hi,

I am trying to create timelion, have 4 fields lets say a,b,c,d. It should perform mathematics calculation like a+b/c+d and it should have one line output.

Any idea how to do it?

Thanks...

Hi,

I am trying to create timelion, have 4 fields lets say a,b,c,d. It should perform mathematics calculation like a+b/c+d and it should have one line output.

Any idea how to do it?

Thanks...

that should be quite simple, but you have not mentioned how you want to aggregate your fields ...

lets say your data looks like this:

```
date | a | b | c | d
1.1.2017 12:00 | 1 | 1 | 2 | 1
1.1.2017 12:45 | 2 | 1 | 2 | 1
1.1.2017 13:00 | 1 | 1 | 1 | 1
2.1.2017 12:00 | 1 | 3 | 2 | 1
```

now in timelion you'll be looking at your daily data for example .... how do you want to treat multiple records from the same day ? do you want to look at average, sum, min, max... ?

so lets say you want to do a sum aggregation then your timelion expression would look something like this:

`.es(metric=sum:a).add(.es(metric=sum:b).divide(.es(metric=sum:c).add(metric=sum:d))`

It works... Thank You!

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

© 2020. All Rights Reserved - Elasticsearch

- Elasticsearch is a trademark of Elasticsearch BV, registered in the U.S. and in other countries
- Trademarks
- Terms
- Privacy
- Brand
- Code of Conduct

Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.