# Trying to parse double colons with grok fails

**URL:** <https://discuss.elastic.co/t/trying-to-parse-double-colons-with-grok-fails/33846>\
**Category:** Logstash\
**Created:** [November 5, 2015, 9:33am UTC](https://discuss.elastic.co/t/trying-to-parse-double-colons-with-grok-fails/33846 "2015-11-05T09:33:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daneel](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@daneel](https://discuss.elastic.co/u/daneel)\
**Post date:** [November 5, 2015, 9:33am UTC](https://discuss.elastic.co/t/trying-to-parse-double-colons-with-grok-fails/33846/1 "2015-11-05T09:33:22Z")

</div>

Hi,  
I'm trying to parse the following strings from a file input:  
::10.10.86.13 \< auth 10.10.86.13 27/10/2015 13:57:01 [test] [123456789132] [] [] [num|123456789456789|1234567894561234] \>

As soon as I try to parse the double colon sequence to take the IP address I get \_grokparsefailure.

The only way I avoid the parse error is:  
match =\> { "auth" =\> "\s\*.\*?" }  
that is useless.

Do you have any idea of how to mess with those colons?

thanks  
daniele

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 5, 2015, 12:09pm UTC](https://discuss.elastic.co/t/trying-to-parse-double-colons-with-grok-fails/33846/2 "2015-11-05T12:09:24Z")

</div>

Colons have no special meaning in regular expressions so I don't understand why you would have a problem. This minimal example shows that it works just fine:

```
$ cat test.config 
input { stdin { } }
output { stdout { codec => rubydebug } }
filter {
  grok {
    match => {
      "message" => "^::%{IP:ip} < auth.*"
    }
  }
}
$ echo '::10.10.86.13 < auth 10.10.86.13 27/10/2015 13:57:01 [test] [123456789132] [] [] [num|123456789456789|1234567894561234] >' | /opt/logstash/bin/logstash -f test.config
Logstash startup completed
{
       "message" => "::10.10.86.13 < auth 10.10.86.13 27/10/2015 13:57:01 [test] [123456789132] [] [] [num|123456789456789|1234567894561234] >",
      "@version" => "1",
    "@timestamp" => "2015-11-05T12:08:21.614Z",
          "host" => "lnxolofon",
            "ip" => "10.10.86.13"
}
Logstash shutdown completed
```

---

<div class="post-metadata">

**Author:** ![daneel](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@daneel](https://discuss.elastic.co/u/daneel)\
**Post date:** [November 5, 2015, 2:40pm UTC](https://discuss.elastic.co/t/trying-to-parse-double-colons-with-grok-fails/33846/3 "2015-11-05T14:40:17Z")

</div>

Hi Magnus,  
thanks for your reply.  
Fortunately the issue was a wrong cut&paste in the grok's match line:  
match =\> { "auth" =\> "\s\*.\*?" }  
I've replaced "auth" with "message" and it worked.

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:** [July 6, 2017, 5:23am UTC](https://discuss.elastic.co/t/trying-to-parse-double-colons-with-grok-fails/33846/4 "2017-07-06T05:23:51Z")

</div>

Closed on July 6, 2017, 5:23am UTC


