# Different pettern syntax of grok between ingest node and logstash

**URL:** <https://discuss.elastic.co/t/different-pettern-syntax-of-grok-between-ingest-node-and-logstash/66713>\
**Category:** Elasticsearch\
**Created:** [November 21, 2016, 12:53pm UTC](https://discuss.elastic.co/t/different-pettern-syntax-of-grok-between-ingest-node-and-logstash/66713 "2016-11-21T12:53:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ginger](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@ginger](https://discuss.elastic.co/u/ginger)\
**Post date:** [November 21, 2016, 12:53pm UTC](https://discuss.elastic.co/t/different-pettern-syntax-of-grok-between-ingest-node-and-logstash/66713/1 "2016-11-21T12:53:42Z")

</div>

Hi.

When I use ingest node to parse data, I found a different pattern syntax of grok between ingest node and logstash. For example, when I use ingest node to parse apache access log, the pattern is:

> %{IPORHOST:clientip} %{USER:ident} %{USER:auth} \\[%{HTTPDATE:timestamp}\\] "%{WORD:verb} %{DATA:request} HTTP/%{NUMBER:httpversion}" %{NUMBER:response:int} (?:-|%{NUMBER:bytes:int}) %{QS:referrer} %{QS:agent}

while when I use logstash to parse the same log, the pattern is:

> %{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "%{WORD:verb} %{DATA:request} HTTP/%{NUMBER:httpversion}" %{NUMBER:response:int} (?:-|%{NUMBER:bytes:int}) %{QS:referrer} %{QS:agent}

The difference is between "\\[" and "\[".

Why not keep consistent syntax?

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [November 22, 2016, 10:26am UTC](https://discuss.elastic.co/t/different-pettern-syntax-of-grok-between-ingest-node-and-logstash/66713/2 "2016-11-22T10:26:44Z")

</div>

This looks like a Java escaping difference to me. Maybe @talevy knows more about this?

---

<div class="post-metadata">

**Author:** ![ginger](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@ginger](https://discuss.elastic.co/u/ginger)\
**Post date:** [November 25, 2016, 3:12am UTC](https://discuss.elastic.co/t/different-pettern-syntax-of-grok-between-ingest-node-and-logstash/66713/3 "2016-11-25T03:12:32Z")

</div>

Any one knows more about this?

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talevy/32/44896_2.png) [@talevy](https://discuss.elastic.co/u/talevy)\
**Post date:** [December 14, 2016, 9:17pm UTC](https://discuss.elastic.co/t/different-pettern-syntax-of-grok-between-ingest-node-and-logstash/66713/4 "2016-12-14T21:17:24Z")

</div>

@mainec is right, this is due to the extra escaping that takes place

---

<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:** [January 11, 2017, 9:17pm UTC](https://discuss.elastic.co/t/different-pettern-syntax-of-grok-between-ingest-node-and-logstash/66713/5 "2017-01-11T21:17:28Z")

</div>

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