# Grok Pattern For Access Log

**URL:** <https://discuss.elastic.co/t/grok-pattern-for-access-log/90626>\
**Category:** Logstash\
**Created:** [June 23, 2017, 11:43am UTC](https://discuss.elastic.co/t/grok-pattern-for-access-log/90626 "2017-06-23T11:43:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_TRAN](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Michael\_TRAN](https://discuss.elastic.co/u/Michael_TRAN)\
**Post date:** [June 23, 2017, 11:43am UTC](https://discuss.elastic.co/t/grok-pattern-for-access-log/90626/1 "2017-06-23T11:43:20Z")

</div>

Hi,

I have a issue with the grok pattern for access log. I try this grok filter %{COMBINEDAPACHELOG} but it's not working.  
I identify why and it's because of this variable "301148" between  
the date and GET

`100.1.1.1 - - [23/Jun/2017:09:17:46 +0200] 301148 "GET /test./test/ " 200 8 "-" "-"`

Do you have an idea of grok pattern for this case ?

Thank you  
Michael

---

<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:** [June 26, 2017, 6:32am UTC](https://discuss.elastic.co/t/grok-pattern-for-access-log/90626/2 "2017-06-26T06:32:52Z")

</div>

Here's the original definition of the patterns (COMBINEDAPACHELOG just points to HTTPD\_COMBINEDLOG):

> <https://github.com/logstash-plugins/logstash-patterns-core/blob/v4.1.1/patterns/httpd#L5-L6>

Make a copy of them and place '%{NUMBER}`after the date, or`%{NUMBER:foo}`if you want to capture the number into the field`foo`.

---

<div class="post-metadata">

**Author:** ![Michael\_TRAN](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Michael\_TRAN](https://discuss.elastic.co/u/Michael_TRAN)\
**Post date:** [June 27, 2017, 9:30am UTC](https://discuss.elastic.co/t/grok-pattern-for-access-log/90626/3 "2017-06-27T09:30:09Z")

</div>

Thank you Magnus !

---

<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 25, 2017, 9:30am UTC](https://discuss.elastic.co/t/grok-pattern-for-access-log/90626/4 "2017-07-25T09:30:12Z")

</div>

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