# Completly lost with how to parse date

**URL:** https://discuss.elastic.co/t/completly-lost-with-how-to-parse-date/189336
**Category:** Logstash
**Created:** [July 8, 2019, 11:46am UTC](https://discuss.elastic.co/t/completly-lost-with-how-to-parse-date/189336 "2019-07-08T11:46:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Elastoc](https://avatars.discourse-cdn.com/v4/letter/e/858c86/32.png) [@Elastoc](https://discuss.elastic.co/u/Elastoc)
#### Post date: [July 8, 2019, 11:46am UTC](https://discuss.elastic.co/t/completly-lost-with-how-to-parse-date/189336/1 "2019-07-08T11:46:24Z")

</div>

Hello,

I'm trying for several hours to parse a logfile and i'm stuck with parsing dates. I have a very hard time understanding how it works. Is there an example somewhere with unusual timestamps?

My log is like this :

> XXX.XXX.XXX.XXX - - [31/May/2019:07:10:01 +0200] "GET -url- HTTP/1.1" 200 446 413 5 "-URL-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0" -URL-

`  
Filters in my ".conf" file :

> ```
> filter {
> grok {
> match => { "message" => "^%{IP:host_ip} - - \[%{TIMESTAMP_ISO8601:logtime}\]" }
> }
> date {
> locale => "fr"
> match => ["logtime" , "dd/MMM/yyyy:HH:mm:ss Z"]
> timezone => "Europe/Paris"
> target => "logtime"
> }
> }
> 
> ```

When i get rid of the timestamp thing, it parse the IP address but not with it...  
What can i do to make it work? Should i mutate the timestamp to get it with "-" and not "/"?

---

<div class="post-metadata">

### Author: ![Elastoc](https://avatars.discourse-cdn.com/v4/letter/e/858c86/32.png) [@Elastoc](https://discuss.elastic.co/u/Elastoc)
#### Post date: [July 8, 2019, 12:24pm UTC](https://discuss.elastic.co/t/completly-lost-with-how-to-parse-date/189336/2 "2019-07-08T12:24:23Z")

</div>

I really was searching for long but just found how to

```
            match => { "message" => "^%{IP:host_ip} - - \[%{HTTPDATE:logtime}\]" }

```

But i still wonder how to do with non predefined patterns...

---

<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 5, 2019, 12:24pm UTC](https://discuss.elastic.co/t/completly-lost-with-how-to-parse-date/189336/3 "2019-08-05T12:24:31Z")

</div>

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