# Logstash grok pattern for apache error log

**URL:** <https://discuss.elastic.co/t/logstash-grok-pattern-for-apache-error-log/337676>\
**Category:** Elasticsearch\
**Created:** [July 5, 2023, 1:14pm UTC](https://discuss.elastic.co/t/logstash-grok-pattern-for-apache-error-log/337676 "2023-07-05T13:14:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjeev1895](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@sanjeev1895](https://discuss.elastic.co/u/sanjeev1895)\
**Post date:** [July 5, 2023, 1:14pm UTC](https://discuss.elastic.co/t/logstash-grok-pattern-for-apache-error-log/337676/1 "2023-07-05T13:14:39Z")

</div>

Hi experts,

Can any one tell me that how to configure the logstash grok custom pattern for apache web server error log. below is my apache web server sample error log,

`[Fri Jun 09 08:26:38.311375 2023] [proxy_fcgi:error] [pid 3905042:tid 140428653360896] (70007)The timeout specified has expired: [client 120.138.12.114:0] AH01075: Error dispatching request to : (polling), referer: https://example.com/`

Thanks.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [July 5, 2023, 1:54pm UTC](https://discuss.elastic.co/t/logstash-grok-pattern-for-apache-error-log/337676/2 "2023-07-05T13:54:05Z")

</div>

Just use: `%{HTTPD_ERRORLOG}`

---

<div class="post-metadata">

**Author:** ![sanjeev1895](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@sanjeev1895](https://discuss.elastic.co/u/sanjeev1895)\
**Post date:** [July 5, 2023, 2:34pm UTC](https://discuss.elastic.co/t/logstash-grok-pattern-for-apache-error-log/337676/3 "2023-07-05T14:34:27Z")

</div>

@Rios Thanks. My requirement is I want to separate the log file field like below, so that they can use the field name and search the logs..  
date\_server1 = Fri Jun 09 08:26:38.311375 2023  
domain\_server1 = [https://example.com/](https://example.com/)

Can you advise for this configuration..

Thanks.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [July 5, 2023, 3:01pm UTC](https://discuss.elastic.co/t/logstash-grok-pattern-for-apache-error-log/337676/4 "2023-07-05T15:01:23Z")

</div>

`\[%{HTTPDERROR_DATE:date_server}\]%{DATA}\s+referer:\s+%{URI:domain_server}`

---

<div class="post-metadata">

**Author:** ![sanjeev1895](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@sanjeev1895](https://discuss.elastic.co/u/sanjeev1895)\
**Post date:** [July 14, 2023, 4:59am UTC](https://discuss.elastic.co/t/logstash-grok-pattern-for-apache-error-log/337676/5 "2023-07-14T04:59:24Z")

</div>

Thank you so much @Rios

---

<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 11, 2023, 5:00am UTC](https://discuss.elastic.co/t/logstash-grok-pattern-for-apache-error-log/337676/6 "2023-08-11T05:00:10Z")

</div>

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