# Unix time to timestamp error: "Wrong argument type Integer, expected LogStash::Timestamp"

**URL:** <https://discuss.elastic.co/t/unix-time-to-timestamp-error-wrong-argument-type-integer-expected-logstash-timestamp/212722>\
**Category:** Logstash\
**Created:** [December 21, 2019, 3:18am UTC](https://discuss.elastic.co/t/unix-time-to-timestamp-error-wrong-argument-type-integer-expected-logstash-timestamp/212722 "2019-12-21T03:18:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wconnell](https://avatars.discourse-cdn.com/v4/letter/w/f4b2a3/32.png) [@wconnell](https://discuss.elastic.co/u/wconnell)\
**Post date:** [December 21, 2019, 3:18am UTC](https://discuss.elastic.co/t/unix-time-to-timestamp-error-wrong-argument-type-integer-expected-logstash-timestamp/212722/1 "2019-12-21T03:18:17Z")

</div>

I'm reading logs into logstash from kafka that all have a field,`ts`. This field stores the unix time in seconds (for example `1576275878`). I'm using the date plugin in logstash to convert it as follows to be stored in the `@timestamp` variable:

```auto
filter {
    date {
        match => ["ts", "UNIX"]
    }
}

```

The conversion is working, however my problem is that each log line spits out the following WARNING message in logstash. Am I doing something wrong with this conversion?

```auto
[2019-12-21T03:10:53,300][WARN][logstash.filters.mutate] Exception caught while applying mutate filter {:exception=>"wrong argument type Integer (expected LogStash:
:Timestamp)"}

```

Thanks for any help!

---

<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:** [December 21, 2019, 1:54pm UTC](https://discuss.elastic.co/t/unix-time-to-timestamp-error-wrong-argument-type-integer-expected-logstash-timestamp/212722/2 "2019-12-21T13:54:50Z")

</div>

What is the mutate filter configuration?

---

<div class="post-metadata">

**Author:** ![wconnell](https://avatars.discourse-cdn.com/v4/letter/w/f4b2a3/32.png) [@wconnell](https://discuss.elastic.co/u/wconnell)\
**Post date:** [December 21, 2019, 5:12pm UTC](https://discuss.elastic.co/t/unix-time-to-timestamp-error-wrong-argument-type-integer-expected-logstash-timestamp/212722/3 "2019-12-21T17:12:43Z")

</div>

Ahh, good call. Further down in that filter section I had the following block of code which was producing the error. Removing this line fixed it:

```auto
  mutate {
    rename => ["ts", "@timestamp"]
  }

```

Thank you!

---

<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:** [January 18, 2020, 5:13pm UTC](https://discuss.elastic.co/t/unix-time-to-timestamp-error-wrong-argument-type-integer-expected-logstash-timestamp/212722/4 "2020-01-18T17:13:01Z")

</div>

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