# Get count of lines in a multiline message field

**URL:** <https://discuss.elastic.co/t/get-count-of-lines-in-a-multiline-message-field/265649>\
**Category:** Logstash\
**Created:** [February 26, 2021, 6:36pm UTC](https://discuss.elastic.co/t/get-count-of-lines-in-a-multiline-message-field/265649 "2021-02-26T18:36:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [February 26, 2021, 7:04pm UTC](https://discuss.elastic.co/t/get-count-of-lines-in-a-multiline-message-field/265649/2 "2021-02-26T19:04:40Z")

</div>

See [here](https://discuss.elastic.co/t/count-number-of-line-in-message-field-multiline-message-field/176842/2). You want to count the number of newlines, not the number of occurences of the string backslash-n.

---

_[View the full topic](https://discuss.elastic.co/t/get-count-of-lines-in-a-multiline-message-field/265649)._
