# Removing zeros from a Timelion metric

**URL:** https://discuss.elastic.co/t/removing-zeros-from-a-timelion-metric/273638
**Category:** Kibana
**Tags:** timelion
**Created:** [May 21, 2021, 8:32am UTC](https://discuss.elastic.co/t/removing-zeros-from-a-timelion-metric/273638 "2021-05-21T08:32:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![InesCM](https://avatars.discourse-cdn.com/v4/letter/i/9d8465/32.png) [@InesCM](https://discuss.elastic.co/u/InesCM)
#### Post date: [May 21, 2021, 8:32am UTC](https://discuss.elastic.co/t/removing-zeros-from-a-timelion-metric/273638/1 "2021-05-21T08:32:27Z")

</div>

Hi all!

I'm trying to display the average CPU temperature of a set of devices, but I need to remove the zeros, as they (obviously because devices are not in the freezer 😄 ) mean that the temperature sensor is just malfunctioning. I'm trying to do this with a Lucene query, but I cannot make it work with the NOT operator.

I've been investigating a bit on this and on Lucene queries in general, and I could not find much, apart from some hints that NOT conditions cannot be used in Lucene without other positive operators, but I'm surprised because removing certain values from a calculation seems like a pretty basic need, right?

This is my query right now. It's giving a syntax error (if I remove the "NOT", it works fine):

`.es(index=device_monitoring*, timefield=dt_EventTimestamp, metric=avg:vl_CPU_Temperature, q=NOT vl_CPU_Temperature:0)`

Thanks a lot in advance for your insight!

---

<div class="post-metadata">

### Author: ![Dzmitry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dzmitry/32/65026_2.png) [@Dzmitry](https://discuss.elastic.co/u/Dzmitry)
#### Post date: [May 21, 2021, 12:40pm UTC](https://discuss.elastic.co/t/removing-zeros-from-a-timelion-metric/273638/2 "2021-05-21T12:40:29Z")

</div>

Hi @InesCM

I think you miss quotes in your expression. I checked it with sample data on 7.12.1:

 ![timelion2](https://us1.discourse-cdn.com/elastic/original/3X/1/6/163bd42c1fa45395dd3de85cf0ff688daca0182c.png)

Give it a try this. way:  
`.es(index=device_monitoring*, timefield=dt_EventTimestamp, metric=avg:vl_CPU_Temperature, q='NOT vl_CPU_Temperature:0')`

This [blog post](https://www.elastic.co/blog/timelion-tutorial-from-zero-to-hero) might give you more insights around timelion

Regards, Dzmitry

---

<div class="post-metadata">

### Author: ![InesCM](https://avatars.discourse-cdn.com/v4/letter/i/9d8465/32.png) [@InesCM](https://discuss.elastic.co/u/InesCM)
#### Post date: [May 24, 2021, 7:12am UTC](https://discuss.elastic.co/t/removing-zeros-from-a-timelion-metric/273638/3 "2021-05-24T07:12:51Z")

</div>

Totally worked, thanks so much, Dzmitry!

---

<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: [June 21, 2021, 7:12am UTC](https://discuss.elastic.co/t/removing-zeros-from-a-timelion-metric/273638/4 "2021-06-21T07:12:57Z")

</div>

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