# Kibana - Gauge - fetch data based on threshold

**URL:** <https://discuss.elastic.co/t/kibana-gauge-fetch-data-based-on-threshold/250206>\
**Category:** Logstash\
**Created:** [September 28, 2020, 2:11pm UTC](https://discuss.elastic.co/t/kibana-gauge-fetch-data-based-on-threshold/250206 "2020-09-28T14:11:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prashu421](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@prashu421](https://discuss.elastic.co/u/prashu421)\
**Post date:** [September 28, 2020, 2:11pm UTC](https://discuss.elastic.co/t/kibana-gauge-fetch-data-based-on-threshold/250206/1 "2020-09-28T14:11:40Z")

</div>

Hello,

I am working with AWS Elasticsearch and have recently started looking into the Kibana Visualizations, I came across a blocker that I am not able to figure how to fix.

I have data coming in from certain pipelines that are processing data files, this data looks something like the below table, where `Source` is the count of total records, `Good` is the count of records processed successfully, and `Grief` is the count that failed and captured for reprocessing.

```
Filename | Source | Good | Grief
----------+--------+------+--------
abcd1.csv | 15 | 13 | 2
abcd2.csv | 70 | 58 | 12
abcd3.csv | 16 | 10 | 4
abcd4.csv | 85 | 81 | 4

```

Right now I have a metric to showcase what all executions came in with grief greater than 0, that looks good and works.

[![enter image description here](https://i.stack.imgur.com/y8hm8.png)](https://i.stack.imgur.com/y8hm8.png)

Now, I am hoping to create another metric, that showcases the count of executions which has grief past certain threshold based on the "Source".  
Now for eg, say 15% of the `Source` records processed are `Grief`, and I am trying to use painless script -  
`{ "script" : "doc['Grief'].value>doc['Source'].value * 0.15" }`  
which seems create no effect.

[![enter image description here](https://i.stack.imgur.com/0Fjzn.png)](https://i.stack.imgur.com/0Fjzn.png)

Is this possible to do this with this visualization? Any leads are appreciated.  
Thank you for reading through.

---

<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:** [October 26, 2020, 2:11pm UTC](https://discuss.elastic.co/t/kibana-gauge-fetch-data-based-on-threshold/250206/2 "2020-10-26T14:11:42Z")

</div>

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