# Filter for message field with specific pattern

**URL:** <https://discuss.elastic.co/t/filter-for-message-field-with-specific-pattern/106543>\
**Category:** Logstash\
**Created:** [November 6, 2017, 2:33pm UTC](https://discuss.elastic.co/t/filter-for-message-field-with-specific-pattern/106543 "2017-11-06T14:33:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![moriol](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@moriol](https://discuss.elastic.co/u/moriol)\
**Post date:** [November 6, 2017, 2:33pm UTC](https://discuss.elastic.co/t/filter-for-message-field-with-specific-pattern/106543/1 "2017-11-06T14:33:37Z")

</div>

I am getting data to Logstash from STOMP input, where my message prints as:

"message" =\> " \< Name\>\n \<Value one="xyz" Two="abc" Three="123" Four="xuz" Five="1aj2" Six="123"/\>\n \<SecondValue One="123" Two="xyz" Three="xyz" Four="xyz"/\>\n \<ThirdValue One="xyz" Two="xyz" Three="xyz"/\>\n \< /Name\>\n"

Whats the best way to match this pattern, in order to parse the fields? After each /n, there is also 5 white spaces.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 6, 2017, 3:03pm UTC](https://discuss.elastic.co/t/filter-for-message-field-with-specific-pattern/106543/2 "2017-11-06T15:03:21Z")

</div>

It looks like XML data so the xml filter should be a good fit.

---

<div class="post-metadata">

**Author:** ![moriol](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@moriol](https://discuss.elastic.co/u/moriol)\
**Post date:** [November 6, 2017, 3:45pm UTC](https://discuss.elastic.co/t/filter-for-message-field-with-specific-pattern/106543/3 "2017-11-06T15:45:02Z")

</div>

Thanks for your answer, that did the trick!

---

<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:** [December 4, 2017, 3:45pm UTC](https://discuss.elastic.co/t/filter-for-message-field-with-specific-pattern/106543/4 "2017-12-04T15:45:36Z")

</div>

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