# Logstash timestamp appearing as text in Elasticsearch

**URL:** <https://discuss.elastic.co/t/logstash-timestamp-appearing-as-text-in-elasticsearch/199239>\
**Category:** Logstash\
**Created:** [September 12, 2019, 11:07am UTC](https://discuss.elastic.co/t/logstash-timestamp-appearing-as-text-in-elasticsearch/199239 "2019-09-12T11:07:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![khat33b](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/khat33b/32/16644_2.png) [@khat33b](https://discuss.elastic.co/u/khat33b)\
**Post date:** [September 12, 2019, 11:07am UTC](https://discuss.elastic.co/t/logstash-timestamp-appearing-as-text-in-elasticsearch/199239/1 "2019-09-12T11:07:13Z")

</div>

I am using Elasticsearch 7.3.1 and Logstash 7.3.1. I am trying to make a field of mine as the Elasticsearch timestamp using the date filter. The data is being inserted properly but the type of `@timestamp` is coming `text`. How do I fix this?

My input timestamp is like `1567408605794750813`. My code is:

```
input {
  elasticsearch {
    hosts => "x.x.x.x"
    index => "raw"
    docinfo => true
  }
}
filter {
  mutate {
    convert => {
      "timestamp" => "integer"
    }
  }
  date {
    match => ["timestamp", "UNIX_MS", "ISO8601"]
    target => "@timestamp"
  }
}
output {
  elasticsearch {
    index => "logs-%{app_name}"
    document_id => "%{[@metadata][_id]}"
  }
}

```

After running the mapping API, I get

```
"@timestamp" : {
  "type" : "text",
  "fields" : {
    "keyword" : {
      "type" : "keyword",
      "ignore_above" : 256
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 14, 2019, 10:29am UTC](https://discuss.elastic.co/t/logstash-timestamp-appearing-as-text-in-elasticsearch/199239/2 "2019-09-14T10:29:14Z")

</div>

As far as I can see that time stamp is not in milliseconds, but rather nanoseconds or similar which is not supported by 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 12, 2019, 10:29am UTC](https://discuss.elastic.co/t/logstash-timestamp-appearing-as-text-in-elasticsearch/199239/3 "2019-10-12T10:29:17Z")

</div>

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