# Add\_field with value from message

**URL:** <https://discuss.elastic.co/t/add-field-with-value-from-message/297777>\
**Category:** Logstash\
**Created:** [February 21, 2022, 3:37pm UTC](https://discuss.elastic.co/t/add-field-with-value-from-message/297777 "2022-02-21T15:37:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex\_vermex](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_vermex/32/101267_2.png) [@alex\_vermex](https://discuss.elastic.co/u/alex_vermex)\
**Post date:** [February 21, 2022, 3:37pm UTC](https://discuss.elastic.co/t/add-field-with-value-from-message/297777/1 "2022-02-21T15:37:36Z")

</div>

Hi,  
filebeat.yml:

```auto
  multiline.type: pattern
  multiline.pattern: '^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s{3}-\sStarting'
  multiline.negate: true
  multiline.match: after
  multiline.max_lines: 140

```

So in my message field now i have a block of lines like I did. I just want when I found the word "id alex" for example add a field  
example line in my message:

```auto
2022-01-01 17:17:13 - id alex =>00011223344556677

```

but i want in this new field to display the value of this "id alex" that means i want "00011223344556677" as value

Any help would be sincerely appreciate!  
Thanks!

---

<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 21, 2022, 3:38pm UTC](https://discuss.elastic.co/t/add-field-with-value-from-message/297777/2 "2022-03-21T15:38:29Z")

</div>

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