# Mysql module in metricbeats is displaying negative values

**URL:** <https://discuss.elastic.co/t/mysql-module-in-metricbeats-is-displaying-negative-values/87501>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [May 30, 2017, 1:52am UTC](https://discuss.elastic.co/t/mysql-module-in-metricbeats-is-displaying-negative-values/87501 "2017-05-30T01:52:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivnath](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@shivnath](https://discuss.elastic.co/u/shivnath)\
**Post date:** [May 30, 2017, 1:52am UTC](https://discuss.elastic.co/t/mysql-module-in-metricbeats-is-displaying-negative-values/87501/1 "2017-05-30T01:52:45Z")

</div>

I am seeing negative values for some of the fields. Please see attached screenshots. This happened when I stopped the MySQL database for some time. My version:

yum list | grep metricbeat  
metricbeat.x86\_64 5.4.0-1 @elasticsearch-5.x  
metricbeat.i686 5.4.0-1 elasticsearch-5.x

 ![](https://us1.discourse-cdn.com/elastic/original/3X/b/5/b5fa848b50e4091f13949fc0aa1d318a2509dff8.png)  
 ![](https://us1.discourse-cdn.com/elastic/original/3X/6/c/6c35ae2ce8afad9a6b5125747a9f6d00ea7df0d9.png)

---

<div class="post-metadata">

**Author:** ![tudor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tudor/32/3753_2.png) [@tudor](https://discuss.elastic.co/u/tudor)\
**Post date:** [May 30, 2017, 9:01am UTC](https://discuss.elastic.co/t/mysql-module-in-metricbeats-is-displaying-negative-values/87501/2 "2017-05-30T09:01:02Z")

</div>

I suspect that's because Timelion displays a derivative of the counter, and the MySQL restart set the counter to zero, causing a brief drop in the derivative value. You can edit the dashboard and add `.if(operator="lt", if=0, then=0)` to ignore the negative values.

---

<div class="post-metadata">

**Author:** ![tudor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tudor/32/3753_2.png) [@tudor](https://discuss.elastic.co/u/tudor)\
**Post date:** [May 30, 2017, 9:01am UTC](https://discuss.elastic.co/t/mysql-module-in-metricbeats-is-displaying-negative-values/87501/3 "2017-05-30T09:01:33Z")

</div>

We should also add that to our dashboards, can you open a Github ticket, please?

---

<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 20, 2017, 1:52am UTC](https://discuss.elastic.co/t/mysql-module-in-metricbeats-is-displaying-negative-values/87501/4 "2017-06-20T01:52:55Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
