# Grokparsefailure with nginx logs

**URL:** <https://discuss.elastic.co/t/grokparsefailure-with-nginx-logs/230753>\
**Category:** Logstash\
**Created:** [May 1, 2020, 6:42pm UTC](https://discuss.elastic.co/t/grokparsefailure-with-nginx-logs/230753 "2020-05-01T18:42:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloudbadmin](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@cloudbadmin](https://discuss.elastic.co/u/cloudbadmin)\
**Post date:** [May 1, 2020, 6:42pm UTC](https://discuss.elastic.co/t/grokparsefailure-with-nginx-logs/230753/1 "2020-05-01T18:42:48Z")

</div>

we have a custom nginx log that looks like this

```auto
172.16.23.132 - [172.16.23.132] - - [30/Apr/2020:20:49:22 +0000] \"GET /health HTTP/2.0\" 200 7 \"-\" \"curl/7.58.0\" 52 0.013 [foobar-apiservice-443] 172.24.12.90:9001 7 0.014 200 foobar

```

and my grok filter looks like this

```auto
%{IPORHOST:client_ip} - \[%{IPORHOST:x_forwarded_for}\] - %{DATA:remote_user} \[%{HTTPDATE:timestamp}\] \\"(?:%{WORD:verb} %{DATA:request}(?: HTTP/%{NUMBER:httpversion})?|-)\\" %{NUMBER:response} (?:%{NUMBER:bytes_sent;long}|-) \\"%{DATA:referrer}\\" \\"%{DATA:agent}\\" %{NUMBER:request_length;long} %{NUMBER:response_time} \[%{DATA:upstream_proxy}\] %{IPORHOST:upstream_addr}:%{POSINT:clientport} %{NUMBER:upstream_response_length} %{NUMBER:upstream_response_time} %{NUMBER:upstream_response} %{NOTSPACE:ingress_namespace}

```

Logs are from containers running in a kubernetes cluster. filebeat reads the docker logs and sends them to logstash. I thought filebeat might be decoding the log incorrectly because the double quotes are getting escape characters. The escape characters are present in the docker logs on each worker.

I can run this through a couple online grok debuggers and it passes. when I put it in my logstash config the logs get tagged with \_grokparsefailure. Is there something I am missing here? How can I go about troubleshooting which field is causing the problem?

---

<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:** [May 2, 2020, 12:40am UTC](https://discuss.elastic.co/t/grokparsefailure-with-nginx-logs/230753/2 "2020-05-02T00:40:35Z")

</div>

> [@cloudbadmin](#):
>
> How can I go about troubleshooting which field is causing the problem?

My answer to that is [here](https://discuss.elastic.co/t/help-needed-in-grok/213827/2). Start with a pattern that matches the first field on a line, then add one field at a time.

---

<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:** [May 30, 2020, 12:40am UTC](https://discuss.elastic.co/t/grokparsefailure-with-nginx-logs/230753/3 "2020-05-30T00:40:48Z")

</div>

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