# HTTPD24\_ERRORLOG grok pattern issues

**URL:** <https://discuss.elastic.co/t/httpd24-errorlog-grok-pattern-issues/207946>\
**Category:** Logstash\
**Created:** [November 14, 2019, 5:52pm UTC](https://discuss.elastic.co/t/httpd24-errorlog-grok-pattern-issues/207946 "2019-11-14T17:52:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeName](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@CodeName](https://discuss.elastic.co/u/CodeName)\
**Post date:** [November 14, 2019, 5:52pm UTC](https://discuss.elastic.co/t/httpd24-errorlog-grok-pattern-issues/207946/1 "2019-11-14T17:52:29Z")

</div>

I am having trouble getting the HTTPD24\_ERRORLOG to work when the module field is blank  
it works great in the kibana tester but not in logstash  
i get a grokparsefailue  
ls config  
input {  
stdin{}  
}  
filter{  
grok{  
match =\> ["message","%{HTTPD24\_ERRORLOG}"]  
}  
}  
output{  
stdout{}  
}

Log that works for me  
[Wed Nov 13 12:39:08.474388 2019] [test:error] [pid 9637] [client 176.10.104.240:42390] script '/home/mydomain.com/public\_html/wp-config.php.o' not found or unable to stat

Log that does not work  
[Wed Nov 13 12:39:08.474388 2019] [:error] [pid 9637] [client 176.10.104.240:42390] script '/home/mydomain.com/public\_html/wp-config.php.o' not found or unable to stat

not sure if this is a problem with the pattern or my logstash.  
logstash 7.4.2

---

<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:** [November 15, 2019, 2:41pm UTC](https://discuss.elastic.co/t/httpd24-errorlog-grok-pattern-issues/207946/2 "2019-11-15T14:41:52Z")

</div>

> [@CodeName](#):
>
> I am having trouble getting the HTTPD24\_ERRORLOG to work when the module field is blank  
> it works great in the kibana tester but not in logstash

The module field is not optional, so I would not expect it to match if it is missing.

---

<div class="post-metadata">

**Author:** ![CodeName](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@CodeName](https://discuss.elastic.co/u/CodeName)\
**Post date:** [November 15, 2019, 4:26pm UTC](https://discuss.elastic.co/t/httpd24-errorlog-grok-pattern-issues/207946/3 "2019-11-15T16:26:13Z")

</div>

well plenty of my logs have it blank.  
like 90% of them.  
also it seems to work fine in the kibana tester without it.  
it must use another grok engine.  
do you know what settings in httpd will force something there?

---

<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:** [November 15, 2019, 5:04pm UTC](https://discuss.elastic.co/t/httpd24-errorlog-grok-pattern-issues/207946/4 "2019-11-15T17:04:25Z")

</div>

> [@CodeName](#):
>
> do you know what settings in httpd will force something there?

No, but the pattern is defined as

```
\[%{HTTPDERROR_DATE:timestamp}\] \[%{WORD:module}:%{LOGLEVEL:loglevel}\] \[pid %{POSINT:pid}(:tid %{NUMBER:tid})?\]( \(%{POSINT:proxy_errorcode}\)%{DATA:proxy_message}:)?( \[client %{IPORHOST:clientip}:%{POSINT:clientport}\])?( %{DATA:errorcode}:)? %{GREEDYDATA:message}

```

You could just define a new pattern that is

```
\[%{HTTPDERROR_DATE:timestamp}\] \[(%{WORD:module})?:%{LOGLEVEL:loglevel}\] \[pid %{POSINT:pid}(:tid %{NUMBER:tid})?\]( \(%{POSINT:proxy_errorcode}\)%{DATA:proxy_message}:)?( \[client %{IPORHOST:clientip}:%{POSINT:clientport}\])?( %{DATA:errorcode}:)? %{GREEDYDATA:message}

```

---

<div class="post-metadata">

**Author:** ![CodeName](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@CodeName](https://discuss.elastic.co/u/CodeName)\
**Post date:** [November 15, 2019, 6:23pm UTC](https://discuss.elastic.co/t/httpd24-errorlog-grok-pattern-issues/207946/5 "2019-11-15T18:23:22Z")

</div>

Thank you so much.  
this seems to work.  
i need to work on getting more familiar with the grok syntax.

---

<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:** [December 13, 2019, 6:38pm UTC](https://discuss.elastic.co/t/httpd24-errorlog-grok-pattern-issues/207946/6 "2019-12-13T18:38:43Z")

</div>

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