# Any grok pattern to extract only uppercase from a string?

**URL:** <https://discuss.elastic.co/t/any-grok-pattern-to-extract-only-uppercase-from-a-string/203504>\
**Category:** Elasticsearch\
**Created:** [October 14, 2019, 6:04pm UTC](https://discuss.elastic.co/t/any-grok-pattern-to-extract-only-uppercase-from-a-string/203504 "2019-10-14T18:04:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashadp](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@ashadp](https://discuss.elastic.co/u/ashadp)\
**Post date:** [October 14, 2019, 6:04pm UTC](https://discuss.elastic.co/t/any-grok-pattern-to-extract-only-uppercase-from-a-string/203504/1 "2019-10-14T18:04:56Z")

</div>

For example, I would like to get only ERROR, HINT, and STATEMENT from below strings

postgresERROR  
postgresHINT  
postgresSTATEMENT

If use "%{WORD:log\_type}", then I get full string as below, but I am interested in only uppercase word. Please suggest if there are any other ways.

{  
"log\_type": [  
"postgresERROR"  
]  
}

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:** [November 11, 2019, 6:05pm UTC](https://discuss.elastic.co/t/any-grok-pattern-to-extract-only-uppercase-from-a-string/203504/2 "2019-11-11T18:05:08Z")

</div>

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