# How to curl PUT timestamp correctly

**URL:** <https://discuss.elastic.co/t/how-to-curl-put-timestamp-correctly/250256>\
**Category:** Elasticsearch\
**Created:** [September 28, 2020, 7:15pm UTC](https://discuss.elastic.co/t/how-to-curl-put-timestamp-correctly/250256 "2020-09-28T19:15:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![buhruce](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@buhruce](https://discuss.elastic.co/u/buhruce)\
**Post date:** [September 28, 2020, 7:15pm UTC](https://discuss.elastic.co/t/how-to-curl-put-timestamp-correctly/250256/1 "2020-09-28T19:15:59Z")

</div>

I admin a Configuration Management tool and it's data visualization is not good. So I'm scraping the data from this tool and dumping it into Elastic Search. Config Tool API -\> Python Script -\> Elast Search API. All the data is ingesting. Each computer record in the configuration tool shows up a doc in ES.

```
name: Bobs laptop serial:D25XXXX osversion:10.13.4 timestamp:Sep 27, 2020 @ 17:00:00.000 _id:8 _type:_doc _index:operatingsystem _score:

```

My issue is timestamp time is its always 17:00:00. The date does change though. I've presented the time with python in various ways with no luck. Suggestions?

Here is my mappings

> **Index Mappings**
>
> > {  
> > "mappings": {  
> > "\_doc": {  
> > "properties": {  
> > "date": {  
> > "type": "long"  
> > },  
> > "name": {  
> > "type": "text",  
> > "fields": {  
> > "keyword": {  
> > "type": "keyword",  
> > "ignore\_above": 256  
> > }  
> > }  
> > },  
> > "osversion": {  
> > "type": "text",  
> > "fields": {  
> > "keyword": {  
> > "type": "keyword",  
> > "ignore\_above": 256  
> > }  
> > }  
> > },  
> > "serial": {  
> > "type": "text",  
> > "fields": {  
> > "keyword": {  
> > "type": "keyword",  
> > "ignore\_above": 256  
> > }  
> > }  
> > },  
> > "timestamp": {  
> > "type": "date"  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > > Blockquote

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 28, 2020, 10:50pm UTC](https://discuss.elastic.co/t/how-to-curl-put-timestamp-correctly/250256/2 "2020-09-28T22:50:53Z")

</div>

Welcome to our community! 😃

> [@buhruce](#):
>
> Config Tool API -\> Python Script -\> Elast Search API

Can you explain this bit a little more?  
What does the script look like?

---

<div class="post-metadata">

**Author:** ![buhruce](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@buhruce](https://discuss.elastic.co/u/buhruce)\
**Post date:** [September 29, 2020, 4:35pm UTC](https://discuss.elastic.co/t/how-to-curl-put-timestamp-correctly/250256/3 "2020-09-29T16:35:49Z")

</div>

The python script will scrape the Configuration Management tool and get info about each computer in the fleet I administer. It builds a dictionary and PUTs it in the ES index I created. This is functional. In my ES server, I can successfully GET a particular doc and it yields the correct information.

I believe I misspoke in my initial question. I believe this to be a Kibana (not ES) issue and how it's interpreting my timestamp mapping. For example, I most recently used unix time as a time stamp. Here is the record:

> **localhost curl GET command**
>
> root@**:~# curl -X GET "localhost:9200/operatingsystem/\_doc/8?pretty"  
> {  
> "\_index" : "operatingsystem",  
> "\_type" : "\_doc",  
> "\_id" : "8",  
> "\_version" : 13,  
> "\_seq\_no" : 11437,  
> "\_primary\_term" : 1,  
> "found" : true,  
> "\_source" : {  
> "name" : "D25R**",  
> "serial" : "D25R\*\*\*\*\*\*\*\*",  
> "os" : "10.13.4",  
> "department" : "AD",  
> "managed" : true,  
> "timestamp" : 1601319800  
> }  
> }

Unix time "1601319800" is: 09/28/2020 @ 7:03pm (UTC)  
In Kibana is shows up as: Jan 19, 1970 @ 04:48:39

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 29, 2020, 9:16pm UTC](https://discuss.elastic.co/t/how-to-curl-put-timestamp-correctly/250256/4 "2020-09-29T21:16:55Z")

</div>

What is that field mapped as in Elasticsearch?

---

<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:** [October 27, 2020, 9:17pm UTC](https://discuss.elastic.co/t/how-to-curl-put-timestamp-correctly/250256/5 "2020-10-27T21:17:03Z")

</div>

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