# Kibana wont recognize my time and date filed as a time and date

**URL:** https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140
**Category:** Kibana
**Created:** [November 17, 2017, 1:46pm UTC](https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140 "2017-11-17T13:46:22Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![I\_like\_dogs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/i_like_dogs/32/24384_2.png) [@I\_like\_dogs](https://discuss.elastic.co/u/I_like_dogs)
#### Post date: [November 17, 2017, 1:46pm UTC](https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140/1 "2017-11-17T13:46:22Z")

</div>

Hello,

I have a date and time field in my logs, see below first lines of field, I've omitted the other fields :  
09/11/2017 17:06  
09/11/2017 17:06  
09/11/2017 17:06  
09/11/2017 17:06  
09/11/2017 17:07  
09/11/2017 17:07  
09/11/2017 17:09  
09/11/2017 17:09  
09/11/2017 17:10

When I upload my logs to Kibana it wont recognize this as time and date so I can't do any time analysis on my logs

input {  
file {  
path =\> "\*\*\*\*"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter {  
csv {  
separator =\> ","

```
    columns => ["timedate","connection_protocol","protocol","srcip","srcport","dstip","dstport","hostname"]

```

}  
date{  
match =\> ["timedate", "dd/MM/yyyy HH:mm:ss"]  
}  
}  
output {  
elasticsearch {  
hosts =\> "[http://localhost:9200](http://localhost:9200)"  
index =\> "timetesting"  
}  
stdout {}  
}  
~

---

<div class="post-metadata">

### Author: ![chrisronline](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrisronline/32/28230_2.png) [@chrisronline](https://discuss.elastic.co/u/chrisronline)
#### Post date: [November 17, 2017, 4:48pm UTC](https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140/2 "2017-11-17T16:48:01Z")

</div>

Hi @I_like_dogs,

Can you provide me the mappings for the index?

`curl -XGET <es_url>/timetesting/_mappings`

Thanks,  
Chris

---

<div class="post-metadata">

### Author: ![I\_like\_dogs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/i_like_dogs/32/24384_2.png) [@I\_like\_dogs](https://discuss.elastic.co/u/I_like_dogs)
#### Post date: [November 20, 2017, 4:01pm UTC](https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140/3 "2017-11-20T16:01:58Z")

</div>

> [@chrisronline](#):
>
> curl -XGET \<es\_url\>/timetesting/\_mappings

{  
"timetestplswork": {  
"mappings": {  
"logs": {  
"properties": {  
"@timestamp": {  
"type": "date"  
},  
"@version": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"connection\_protocol": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"dstip": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"dstport": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"host": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"message": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"path": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"protocol": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"srcip": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"srcport": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"tags": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"timestamp": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
}  
}  
}  
}  
}  
}

FOR:

input {  
file {  
path =\> "\*\*\*\*\*\*"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter {  
csv {  
separator =\> ","  
#connection\_type, connection\_protocol, protocol, srcip, srcport, dstip, dstport, hostname  
columns =\> ["timestamp","connection\_protocol","protocol","srcip","srcport","dstip","dstport","hostname"]  
}  
date{  
match =\> ["timestamp", "dd/MM/yyyy HH:mm:ss"]  
timezone =\> "UTC"

}  
}  
output {  
elasticsearch {  
hosts =\> "[http://localhost:9200](http://localhost:9200)"  
index =\> "timetestplswork"  
}  
stdout {}  
}

---

<div class="post-metadata">

### Author: ![chrisronline](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrisronline/32/28230_2.png) [@chrisronline](https://discuss.elastic.co/u/chrisronline)
#### Post date: [November 20, 2017, 4:20pm UTC](https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140/4 "2017-11-20T16:20:51Z")

</div>

> [@I\_like\_dogs](#):
>
> "timestamp": {
> 
> "type": "text",
> 
> "fields": {
> 
> "keyword": {
> 
> "type": "keyword",
> 
> "ignore\_above": 256
> 
> }
> 
> }

Try using the [date datatype](https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html) instead. Then, Kibana will understand that it is a date field and allow the appropriate aggregations.

---

<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 20, 2017, 4:32pm UTC](https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140/5 "2017-11-20T16:32:59Z")

</div>

> [@I\_like\_dogs](#):
>
> match =\> ["timedate", "dd/MM/yyyy HH:mm:ss"]

Your timestamps do not have a seconds field, so this does not match. I see the events having a \_dateparsefailure tag. Use dd/MM/yyyy HH:mm.

---

<div class="post-metadata">

### Author: ![I\_like\_dogs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/i_like_dogs/32/24384_2.png) [@I\_like\_dogs](https://discuss.elastic.co/u/I_like_dogs)
#### Post date: [November 20, 2017, 9:26pm UTC](https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140/6 "2017-11-20T21:26:43Z")

</div>

I copied and pasted the first lines off excel, my mistake. when you double click on the cells there is the seconds

---

<div class="post-metadata">

### Author: ![I\_like\_dogs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/i_like_dogs/32/24384_2.png) [@I\_like\_dogs](https://discuss.elastic.co/u/I_like_dogs)
#### Post date: [November 22, 2017, 11:45am UTC](https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140/7 "2017-11-22T11:45:54Z")

</div>

Hi Chris, I'm new to elasticsearch/Kibana

Do I use this in the Dev tools?

---

<div class="post-metadata">

### Author: ![chrisronline](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrisronline/32/28230_2.png) [@chrisronline](https://discuss.elastic.co/u/chrisronline)
#### Post date: [November 22, 2017, 8:05pm UTC](https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140/8 "2017-11-22T20:05:21Z")

</div>

Yup!

You'll want to create a new index and [set the appropriate mappings](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html).

Then you can try [reindexing](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html) your existing index to this new index.

After that, create an index pattern in Kibana using the new index and see if you can do time analysis on your logs.

---

<div class="post-metadata">

### Author: ![I\_like\_dogs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/i_like_dogs/32/24384_2.png) [@I\_like\_dogs](https://discuss.elastic.co/u/I_like_dogs)
#### Post date: [November 24, 2017, 1:45pm UTC](https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140/9 "2017-11-24T13:45:01Z")

</div>

thank you!!! it worked 🙂

---

<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 22, 2017, 1:45pm UTC](https://discuss.elastic.co/t/kibana-wont-recognize-my-time-and-date-filed-as-a-time-and-date/108140/10 "2017-12-22T13:45:19Z")

</div>

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