# Custom Grok Patterns in Docker Logstash

**URL:** <https://discuss.elastic.co/t/custom-grok-patterns-in-docker-logstash/223340>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [March 12, 2020, 1:51pm UTC](https://discuss.elastic.co/t/custom-grok-patterns-in-docker-logstash/223340 "2020-03-12T13:51:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin5617](https://avatars.discourse-cdn.com/v4/letter/k/46a35a/32.png) [@kevin5617](https://discuss.elastic.co/u/kevin5617)\
**Post date:** [March 12, 2020, 1:51pm UTC](https://discuss.elastic.co/t/custom-grok-patterns-in-docker-logstash/223340/1 "2020-03-12T13:51:28Z")

</div>

I'm using Logstash as a Docker container, and I know I can add a line like the following inside a grok block

```
patterns_dir => ["/opt/logstash/patterns", "/opt/logstash/extra_patterns"]

```

However, since I am using this as Docker, I want to be able to add these permanently, so I don't have to create this new directory every time I restart my container. Is this possible?

---

<div class="post-metadata">

**Author:** ![kevin5617](https://avatars.discourse-cdn.com/v4/letter/k/46a35a/32.png) [@kevin5617](https://discuss.elastic.co/u/kevin5617)\
**Post date:** [March 12, 2020, 3:59pm UTC](https://discuss.elastic.co/t/custom-grok-patterns-in-docker-logstash/223340/2 "2020-03-12T15:59:55Z")

</div>

Update: I found out about the pattern\_definitions for grok. This is probably what I want.

---

<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:** [April 9, 2020, 4:00pm UTC](https://discuss.elastic.co/t/custom-grok-patterns-in-docker-logstash/223340/3 "2020-04-09T16:00:00Z")

</div>

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