# How to parse apache error.log

**URL:** <https://discuss.elastic.co/t/how-to-parse-apache-error-log/300822>\
**Category:** Logstash\
**Created:** [March 28, 2022, 9:41am UTC](https://discuss.elastic.co/t/how-to-parse-apache-error-log/300822 "2022-03-28T09:41:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roccof97](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roccof97/32/97628_2.png) [@Roccof97](https://discuss.elastic.co/u/Roccof97)\
**Post date:** [March 28, 2022, 9:41am UTC](https://discuss.elastic.co/t/how-to-parse-apache-error-log/300822/1 "2022-03-28T09:41:13Z")

</div>

Hi,

help! i can't parse this timestamp:

[Mon Mar 28 09:02:28.627528 2022] [mpm\_winnt:notice] [pid 0000:tid 000] 0000000: Apache/00.00.0.0 (Win00) OpenSSL/0.0.0h configured -- resuming normal operations

suggestions?

Thanks

---

<div class="post-metadata">

**Author:** ![Roccof97](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roccof97/32/97628_2.png) [@Roccof97](https://discuss.elastic.co/u/Roccof97)\
**Post date:** [March 28, 2022, 2:45pm UTC](https://discuss.elastic.co/t/how-to-parse-apache-error-log/300822/2 "2022-03-28T14:45:57Z")

</div>

this is my code:

if [fields][log\_module] == "apacherror" {  
grok {  
match =\> { "message" =\> "[%{DATA:timestamp}]" }}  
date {  
match =\> ["timestamp" , "EEE MMM dd HH:mm:ss YYYY"]  
locale =\> "en"  
}  
}

---

<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:** [March 28, 2022, 2:48pm UTC](https://discuss.elastic.co/t/how-to-parse-apache-error-log/300822/3 "2022-03-28T14:48:27Z")

</div>

> [@Roccof97](#):
>
> match =\> ["timestamp" , "EEE MMM dd HH:mm:ss YYYY"]

It seems unlikely that your grok will match just the timestamp, but in case it does, the date pattern has to match the whole of the field, so you should use `EEE MMM dd HH:mm:ss.SSSSSS YYYY`.

---

<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 25, 2022, 2:49pm UTC](https://discuss.elastic.co/t/how-to-parse-apache-error-log/300822/4 "2022-04-25T14:49:04Z")

</div>

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