# Building graph with network statistic

**URL:** <https://discuss.elastic.co/t/building-graph-with-network-statistic/120169>\
**Category:** Kibana\
**Created:** [February 16, 2018, 12:36pm UTC](https://discuss.elastic.co/t/building-graph-with-network-statistic/120169 "2018-02-16T12:36:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikita\_Krasnov](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nikita\_Krasnov](https://discuss.elastic.co/u/Nikita_Krasnov)\
**Post date:** [February 16, 2018, 12:36pm UTC](https://discuss.elastic.co/t/building-graph-with-network-statistic/120169/1 "2018-02-16T12:36:07Z")

</div>

I use: Kibana, Elastic, MetricBeat  
I try to recreate this example: [https://www.elastic.co/guide/en/kibana/6.1/timelion-math.html](https://www.elastic.co/guide/en/kibana/6.1/timelion-math.html)  
with system.network.out.bytes but I get negative values.

 ![Network](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5da521d4693e8281043426f869ad63f6b4420fb6.png)

Why I get negative values? Why we have to use `max` but not `avg` here?  
When I split it by value `"beat.hostname"` I also get negative values:

 ![Network2](https://us1.discourse-cdn.com/elastic/original/3X/0/c/0cbd1191797b6bd4f40488dfdef31670c3b0c5f5.png)

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [February 16, 2018, 6:26pm UTC](https://discuss.elastic.co/t/building-graph-with-network-statistic/120169/2 "2018-02-16T18:26:52Z")

</div>

It looks to me like some of the ranges possibly have no data, meaning the max system.network.in.bytes is 0 for that interval. Could you try setting an interval to something other than "auto", like perhaps "1m"?

The reason you're getting negative values is because a derivative shows the rate of change, and if you have one interval where the value is 10 million, and then the next interval has no data (and thus a max of 0), the rate of change is -10 million, which is what is displayed in the graph.

---

<div class="post-metadata">

**Author:** ![Nikita\_Krasnov](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nikita\_Krasnov](https://discuss.elastic.co/u/Nikita_Krasnov)\
**Post date:** [February 19, 2018, 8:09am UTC](https://discuss.elastic.co/t/building-graph-with-network-statistic/120169/3 "2018-02-19T08:09:37Z")

</div>

What in such case is the best to use: avg or max?  
Here is the result when I use interval = 1m

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/d/4d365b1071d64c61fe47096daf074975ac097fa2.png)  
So, you think that's because some intervals doesn't contain any data?

---

<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:** [March 19, 2018, 8:09am UTC](https://discuss.elastic.co/t/building-graph-with-network-statistic/120169/4 "2018-03-19T08:09:57Z")

</div>

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