# Getting single line from multiline

**URL:** <https://discuss.elastic.co/t/getting-single-line-from-multiline/272292>\
**Category:** Logstash\
**Created:** [May 6, 2021, 12:35pm UTC](https://discuss.elastic.co/t/getting-single-line-from-multiline/272292 "2021-05-06T12:35:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Learn\_Mulesoft\_With](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/learn_mulesoft_with/32/87561_2.png) [@Learn\_Mulesoft\_With](https://discuss.elastic.co/u/Learn_Mulesoft_With)\
**Post date:** [May 6, 2021, 12:35pm UTC](https://discuss.elastic.co/t/getting-single-line-from-multiline/272292/1 "2021-05-06T12:35:32Z")

</div>

hi ,

my message is like below

Error type : VALIDATION:INVALID\_NUMBER  
FlowStack : at db-error-logFlow(db-error-logFlow/processors/0 @ db-error-log:db-error-log.xml:18

i want just single line " Error type : VALIDATION:INVALID\_NUMBER"

i am using below code

if "Error type" in [rsys\_message]{  
grok  
{  
match =\> ["cp\_msg","(?\<Error\_type\>.(Error type :).{22})"]  
}  
mutate  
{  
gsub =\> ["Error\_type", "Error type :", ""]  
}  
}

can we get single line without specifing length in statement

" match =\> ["cp\_msg","(?\<Error\_type\>.(Error type :).{22})"] "

---

<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:** [June 3, 2021, 12:35pm UTC](https://discuss.elastic.co/t/getting-single-line-from-multiline/272292/2 "2021-06-03T12:35:37Z")

</div>

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