# Timelion - Failure Rate problem

**URL:** <https://discuss.elastic.co/t/timelion-failure-rate-problem/242047>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [July 21, 2020, 2:34pm UTC](https://discuss.elastic.co/t/timelion-failure-rate-problem/242047 "2020-07-21T14:34:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomszy](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@Tomszy](https://discuss.elastic.co/u/Tomszy)\
**Post date:** [July 21, 2020, 2:34pm UTC](https://discuss.elastic.co/t/timelion-failure-rate-problem/242047/1 "2020-07-21T14:34:42Z")

</div>

Dear All,

I would like to create Timelion line chart which should show the failure rate in %.  
The 'info' field shoudl contain 2 value. FAILED or PASSED  
I have this query:

`(.es(index=my-index-*,timefield=@timestamp,q='name: "Ape Report Result -" AND result:"First run*" AND info:FAILED',metric=count).divide( **13** )).cusum().multiply(100)`  
This is good:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/d/0de852f0234369a839a283de2b61bf5c9d81028a.png)

It shows the good chart as I expected, but only when I hardcoded a value into the divide function.

How can I substitute the "13" with a count number based on another query.  
Like this:

```
   .es(index=my-index-*,q='name: "Ape Report Result -" AND result:"First run*" AND info:*')

```

It should give the passed + failed records as well.  
I tried to include it into the divide function but the result is bad:  
`(.es(index=gbucs-docstore-*,timefield=@timestamp,q='name: "Ape Report Result -" AND result:"First run*" AND info:FAILED',metric=count).divide(.es(index=my-index-*,q='name: "result: First run*" AND info:*'))).cusum().multiply(100)`

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/9/b95b777292d9be01932b54604812d01a8a70eaae.png)

Can somebody help me?

Thanks!

---

<div class="post-metadata">

**Author:** ![Tomszy](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@Tomszy](https://discuss.elastic.co/u/Tomszy)\
**Post date:** [July 21, 2020, 3:25pm UTC](https://discuss.elastic.co/t/timelion-failure-rate-problem/242047/2 "2020-07-21T15:25:07Z")

</div>

I think I found the solution. 😃 added `.aggregate(sum)`

---

<div class="post-metadata">

**Author:** ![Tomszy](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@Tomszy](https://discuss.elastic.co/u/Tomszy)\
**Post date:** [July 21, 2020, 3:56pm UTC](https://discuss.elastic.co/t/timelion-failure-rate-problem/242047/3 "2020-07-21T15:56:28Z")

</div>

Just one question.

Is there any way to create smoothed lines in Timelion?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 18, 2020, 3:56pm UTC](https://discuss.elastic.co/t/timelion-failure-rate-problem/242047/4 "2020-08-18T15:56:32Z")

</div>

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