# Logstash grok pattern for custom nginx access log

**URL:** <https://discuss.elastic.co/t/logstash-grok-pattern-for-custom-nginx-access-log/309933>\
**Category:** Logstash\
**Created:** [July 18, 2022, 5:46pm UTC](https://discuss.elastic.co/t/logstash-grok-pattern-for-custom-nginx-access-log/309933 "2022-07-18T17:46:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kosmylo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kosmylo/32/99660_2.png) [@kosmylo](https://discuss.elastic.co/u/kosmylo)\
**Post date:** [July 18, 2022, 5:46pm UTC](https://discuss.elastic.co/t/logstash-grok-pattern-for-custom-nginx-access-log/309933/1 "2022-07-18T17:46:09Z")

</div>

I have a custom format of nginx `access.log` and I want to parse it with `logstash`.

The format of the access log is the following:

```auto
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for" ';

```

I was not able to find what kind of `grok match pattern` to use. Any idea of how can I deal with it?

---

<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:** [August 15, 2022, 5:46pm UTC](https://discuss.elastic.co/t/logstash-grok-pattern-for-custom-nginx-access-log/309933/2 "2022-08-15T17:46:32Z")

</div>

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