# Looking for a way, size of log event

**URL:** <https://discuss.elastic.co/t/looking-for-a-way-size-of-log-event/224805>\
**Category:** Logstash\
**Created:** [March 24, 2020, 10:37am UTC](https://discuss.elastic.co/t/looking-for-a-way-size-of-log-event/224805 "2020-03-24T10:37:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shwesinhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shwesinhan/32/78663_2.png) [@shwesinhan](https://discuss.elastic.co/u/shwesinhan)\
**Post date:** [March 24, 2020, 10:37am UTC](https://discuss.elastic.co/t/looking-for-a-way-size-of-log-event/224805/1 "2020-03-24T10:37:38Z")

</div>

Hello community,

Is there any way to know message size in `b` or `kb` or `mb` or any unit of digital info in logstash?  
eg: logstash get message `ABCDEFBADFASFD13241325POIYTUUBLABLABLA`  
How can we know that message size? Is that possible in logstash?  
Which plugin is suitable? appreciate any idea 🙏

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 24, 2020, 12:29pm UTC](https://discuss.elastic.co/t/looking-for-a-way-size-of-log-event/224805/2 "2020-03-24T12:29:45Z")

</div>

Does [this](https://discuss.elastic.co/t/logstash-output-to-kafka-server/197710/6) help?

---

<div class="post-metadata">

**Author:** ![shwesinhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shwesinhan/32/78663_2.png) [@shwesinhan](https://discuss.elastic.co/u/shwesinhan)\
**Post date:** [April 14, 2020, 8:50am UTC](https://discuss.elastic.co/t/looking-for-a-way-size-of-log-event/224805/3 "2020-04-14T08:50:55Z")

</div>

Yes, it's helpful. @Badger Thanks man  
I use this code snippet  
`ruby { code => "event.set('log_size', event.get('message').bytesize)" }`

---

<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:** [May 12, 2020, 8:57am UTC](https://discuss.elastic.co/t/looking-for-a-way-size-of-log-event/224805/4 "2020-05-12T08:57:27Z")

</div>

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