# How to serach message including "keyword" and format message

**URL:** <https://discuss.elastic.co/t/how-to-serach-message-including-keyword-and-format-message/248701>\
**Category:** Logstash\
**Created:** [September 15, 2020, 3:06pm UTC](https://discuss.elastic.co/t/how-to-serach-message-including-keyword-and-format-message/248701 "2020-09-15T15:06:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NouhaB](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@NouhaB](https://discuss.elastic.co/u/NouhaB)\
**Post date:** [September 15, 2020, 3:06pm UTC](https://discuss.elastic.co/t/how-to-serach-message-including-keyword-and-format-message/248701/1 "2020-09-15T15:06:26Z")

</div>

Hello,

I need to filter logs in order to get only the message begining by "CALL\_END"

This is an example of logs :

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/3/5317f3090750c391b71bef9e78eea7df2600e0b9.png)

here is my logstash config file :  
''  
input {  
udp {  
port =\> 2514  
type =\> "syslog"  
}  
}

filter{  
if "CALL\_END" in [message] {  
grok {  
match =\> {  
"message" =\>  
"(?[^|]_) \|%{WORD:method} | %{WORD:SBC} | %{WORD:name3}@%{IP:IP2} |(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?\<Term\_raison\>[^|]_)|(?[^|]_)|(?\<Initialising\_call\>[^|]_)|(?\<Start\_call\>[^|]_)|(?\<End\_call\>[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)|(?[^|]_)  
"}  
}}}

output {  
elasticsearch { hosts =\> ["localhost:9200"] }  
stdout { codec =\> rubydebug }  
}  
''  
But the filter is not working.

Any help please ?  
Thanks in advance

---

<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:** [October 13, 2020, 3:06pm UTC](https://discuss.elastic.co/t/how-to-serach-message-including-keyword-and-format-message/248701/2 "2020-10-13T15:06:33Z")

</div>

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