# Help to create new field from message

**URL:** <https://discuss.elastic.co/t/help-to-create-new-field-from-message/323698>\
**Category:** Logstash\
**Created:** [January 23, 2023, 5:09am UTC](https://discuss.elastic.co/t/help-to-create-new-field-from-message/323698 "2023-01-23T05:09:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_1995](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_1995/32/116263_2.png) [@Sam\_1995](https://discuss.elastic.co/u/Sam_1995)\
**Post date:** [January 23, 2023, 5:09am UTC](https://discuss.elastic.co/t/help-to-create-new-field-from-message/323698/1 "2023-01-23T05:09:30Z")

</div>

Hello,

I m looking for a way (maybe with grok), to create new field by extracting some specified pattern but with keeping the field message without modification after operation

Example Pattern

2023-01-23 10:33:25 [ALB-ID : Root=1-63ce151d-11eb303302cfe4382c61a851] [7640768e8bb07414] [7640768e8bb07414] [boundedElastic-144] INFO c.o.a.decorators.DataDecorator.processResponse(105) - requestId: 99f49b2e-186493, method: POST, url: /api/Communication/acl/webhook, RawStatusCode :200 TOTAL\_TIME\_TAKEN :26ms

Need to create new field TOTAL\_TIME\_TAKEN with value 26ms

thx a lot for help

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [January 23, 2023, 8:27am UTC](https://discuss.elastic.co/t/help-to-create-new-field-from-message/323698/2 "2023-01-23T08:27:50Z")

</div>

If you like to separate the number and the unit:

```auto
grok {
      match => { "message" => "TOTAL_TIME_TAKEN :%{INT:totaltimetaken:int}%{GREEDYDATA:unit}" }
 }

```

Or you want in a single value:  
match =\> { "message" =\> "TOTAL\_TIME\_TAKEN :TOTAL\_TIME\_TAKEN :%{GREEDYDATA:totaltimetaken}" }

---

<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:** [February 20, 2023, 8:28am UTC](https://discuss.elastic.co/t/help-to-create-new-field-from-message/323698/3 "2023-02-20T08:28:04Z")

</div>

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