# Getting sizes of logs per month per device

**URL:** <https://community.graylog.org/t/getting-sizes-of-logs-per-month-per-device/26715>\
**Category:** Graylog Central (peer support)\
**Created:** [November 29, 2022, 9:33pm UTC](https://community.graylog.org/t/getting-sizes-of-logs-per-month-per-device/26715 "2022-11-29T21:33:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmuensterer](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/dmuensterer/32/13602_2.png) [@dmuensterer](https://community.graylog.org/u/dmuensterer)\
**Post date:** [November 29, 2022, 9:33pm UTC](https://community.graylog.org/t/getting-sizes-of-logs-per-month-per-device/26715/1 "2022-11-29T21:33:31Z")

</div>

**Don’t forget to select tags to help index your topic!**  
I’d like to create reports/dashboards on how great the log size is per timeframe, that is, any given device sends per month.  
I understand there have been several attempts to do this, mostly using the \_size field of Elasticsearch.  
Is there a reason why the already existing field `gl2_accounted_message_size` shouldn’t be used for this?

I’d simply create a search device:MyDeviceName to search through the last month and a metric aggregating sum(gl2\_accounted\_message\_size).

I don’t understand, however, why e.g. the following thread uses separate Python scripts instead of simply aggregating the messages. Anything I’m missing here?

> [@Use of gl2\_accounted\_message\_size for measuring outgoing traffic](https://community.graylog.org/t/use-of-gl2-accounted-message-size-for-measuring-outgoing-traffic/25822/7):
>
> Pretty freakin amazing +1 EDIT: Oh I see, I must have missed that, good catch \> db.traffic.find().Prtty() uncaught exception: TypeError: db.traffic.find(...).Prtty is not a function : @(shell):1:1 \> db.traffic.find().pretty() { "\_id" : ObjectId("5a501e28e433355eb03b71e3"), "bucket" : ISODate("2018-01-06T00:00:00Z"), "decoded" : { "c7f567fc-5ff7-459c-99f2-bf088359cd7a" : NumberLong(0) }, "output" : { "c7f567fc-5ff7-459c-…

---

<div class="post-metadata">

**Author:** ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)\
**Post date:** [November 29, 2022, 10:23pm UTC](https://community.graylog.org/t/getting-sizes-of-logs-per-month-per-device/26715/2 "2022-11-29T22:23:43Z")

</div>

Hey @dmuensterer

See you dug up an old post.

> [@dmuensterer](#):
>
> Python scripts instead of simply aggregating the messages. Anything I’m missing here?

What that member was trying to do was get the Outgoing traffic. So Python was easiest way to do that which grabbed the metrics from MongoDb. From there you can see in this members screen shot they were able to calculate GB per day, averages , etc…It depends on what you want to do.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [December 13, 2022, 10:24pm UTC](https://community.graylog.org/t/getting-sizes-of-logs-per-month-per-device/26715/3 "2022-12-13T22:24:27Z")

</div>

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