# How to parse timestamp apache access.log

**URL:** <https://discuss.elastic.co/t/how-to-parse-timestamp-apache-access-log/300709>\
**Category:** Logstash\
**Created:** [March 25, 2022, 2:02pm UTC](https://discuss.elastic.co/t/how-to-parse-timestamp-apache-access-log/300709 "2022-03-25T14:02:24Z")\
**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 25, 2022, 2:02pm UTC](https://discuss.elastic.co/t/how-to-parse-timestamp-apache-access-log/300709/1 "2022-03-25T14:02:24Z")

</div>

Hi,

how can i parse this timestamp using grok filter?:  
x.x.x.x - - [24/Mar/2022:00:00:04 +0000]

do you have any advice?

Thanks

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [March 25, 2022, 2:12pm UTC](https://discuss.elastic.co/t/how-to-parse-timestamp-apache-access-log/300709/2 "2022-03-25T14:12:27Z")

</div>

**Filter**

```auto
grok {
  match => {
    "message" => "%{DATA:ip} - - \[%{GREEDYDATA:logdate}\]"
  }
}

date {
  match => ["logdate", "dd/MMM/yyyy:HH:mm:ss Z"]
}

```

**Output**

```auto
2022-03-24T00:00:04.000Z

```

Note - Might not need the escapes `\[` `\]` in Logstash but they are needed in Grok Debugger where I tested.

---

<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 25, 2022, 3:39pm UTC](https://discuss.elastic.co/t/how-to-parse-timestamp-apache-access-log/300709/3 "2022-03-25T15:39:30Z")

</div>

thank you aron

---

<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 22, 2022, 3:40pm UTC](https://discuss.elastic.co/t/how-to-parse-timestamp-apache-access-log/300709/4 "2022-04-22T15:40:00Z")

</div>

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