# Grok pattern not working with spaces

**URL:** <https://discuss.elastic.co/t/grok-pattern-not-working-with-spaces/277254>\
**Category:** Logstash\
**Created:** [June 28, 2021, 3:59pm UTC](https://discuss.elastic.co/t/grok-pattern-not-working-with-spaces/277254 "2021-06-28T15:59:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kriss332](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kriss332/32/90137_2.png) [@kriss332](https://discuss.elastic.co/u/kriss332)\
**Post date:** [June 28, 2021, 3:59pm UTC](https://discuss.elastic.co/t/grok-pattern-not-working-with-spaces/277254/1 "2021-06-28T15:59:12Z")

</div>

Hi all , I am trying to get a pattern for tbelow log in GrokDebugger site.

`Jun 27 00:00:12 location2-squid2 SQUID 1624732203.029 877 172.1.1.1 TCP_MISS/200 70205 GET http://10.10.1.1/v1/loading/summary? - HIER_DIRECT/10.24.1.71 application/json`

What I've been able to match so far is-

`%{WORD:month} %{NUMBER:date} %{TIME:time} %{HOSTNAME:system} %{WORD:type} %{NUMBER:datetime}`

The last match is -

`"datetime": [[ "1624732203.029"] ]`

It seems that next block 877 number is appearing after a tab. But the pattern `%{WORD:month} %{NUMBER:date} %{TIME:time} %{HOSTNAME:system} %{WORD:type} %{NUMBER:datetime}\t%{NUMBER:elapsed}` fails when I try to map 877 (even using multiple spaces instead of `\t` it dowsn't match).  
Any help would be appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 28, 2021, 4:38pm UTC](https://discuss.elastic.co/t/grok-pattern-not-working-with-spaces/277254/2 "2021-06-28T16:38:40Z")

</div>

Have you tried `\s+`? That should match one or more spaces or tabs.

---

<div class="post-metadata">

**Author:** ![kriss332](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kriss332/32/90137_2.png) [@kriss332](https://discuss.elastic.co/u/kriss332)\
**Post date:** [June 28, 2021, 4:54pm UTC](https://discuss.elastic.co/t/grok-pattern-not-working-with-spaces/277254/3 "2021-06-28T16:54:40Z")

</div>

That worked. Thanks alot @Badger  
Is there a good site for referencing everything related to GROK patterns and their nitty gritty details !!!

---

<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:** [July 26, 2021, 4:54pm UTC](https://discuss.elastic.co/t/grok-pattern-not-working-with-spaces/277254/4 "2021-07-26T16:54:55Z")

</div>

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