# Date format with month's name

**URL:** https://discuss.elastic.co/t/date-format-with-months-name/94344
**Category:** Elasticsearch
**Created:** [July 24, 2017, 2:28pm UTC](https://discuss.elastic.co/t/date-format-with-months-name/94344 "2017-07-24T14:28:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mlassnig](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@mlassnig](https://discuss.elastic.co/u/mlassnig)
#### Post date: [July 24, 2017, 2:28pm UTC](https://discuss.elastic.co/t/date-format-with-months-name/94344/1 "2017-07-24T14:28:26Z")

</div>

Hello there!

I'm new to Elasticsearch, so please be patient.  
I didn't find a solution for my issue, so i thought I might try here.

I use a Logstash pipeline to parse my logs to Elasticsearch. My date format looks like this:

28/Mar/2017:07:21:08 +0200

It's parsable using the grok %{HTTPDATE:timestamp} pattern but it's then saved as a string in Elasticsearch, meaning it is not aggregatable and thus useless in my case.  
How can i make Elasticsearch save it as a date?  
I tried using a mapping, but i didn't find any method of parsing it with the written month (e.g "Jan", "Feb", "Mar"...)

I hope somebody can help me, thanks in advance.  
Kindest regards  
Matthias

---

<div class="post-metadata">

### Author: ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)
#### Post date: [July 24, 2017, 8:16pm UTC](https://discuss.elastic.co/t/date-format-with-months-name/94344/2 "2017-07-24T20:16:43Z")

</div>

Hi,

First you can read this post: [Invalid format of timestamp](https://discuss.elastic.co/t/invalid-format-of-timestamp/94238/2?u=xavierfacq)

Note that if you change the mapping you have to re-create an index with the new mapping.  
Your date format will be something like that:

"dd/MMM/yyyy:HH:mm:ss Z"

bye,  
Xavier

---

<div class="post-metadata">

### Author: ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)
#### Post date: [July 24, 2017, 8:46pm UTC](https://discuss.elastic.co/t/date-format-with-months-name/94344/3 "2017-07-24T20:46:04Z")

</div>

> [@xavierfacq](#):
>
> "dd/MMM/yyyy:HH:mm:ss Z"

It may be bad, because I'm not able to parse a month with 3 letters in French, but it works in english...

**OK**

```
		DateTimeFormatter format = DateTimeFormat.forPattern("MMM");
		DateTime instance = format.withLocale(Locale.ENGLISH).parseDateTime("Oct");  

```

**KO**

```
		DateTimeFormatter format = DateTimeFormat.forPattern("MMM");
		DateTime instance = format.withLocale(Locale.FRENCH).parseDateTime("Oct");  

```

#SuperStrange...

---

<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 21, 2017, 8:46pm UTC](https://discuss.elastic.co/t/date-format-with-months-name/94344/4 "2017-08-21T20:46:37Z")

</div>

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