# Logstash timestamp parse failed

**URL:** <https://discuss.elastic.co/t/logstash-timestamp-parse-failed/145713>\
**Category:** Logstash\
**Created:** [August 23, 2018, 11:29am UTC](https://discuss.elastic.co/t/logstash-timestamp-parse-failed/145713 "2018-08-23T11:29:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timofey\_Gusev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timofey_gusev/32/34756_2.png) [@Timofey\_Gusev](https://discuss.elastic.co/u/Timofey_Gusev)\
**Post date:** [August 23, 2018, 11:29am UTC](https://discuss.elastic.co/t/logstash-timestamp-parse-failed/145713/1 "2018-08-23T11:29:52Z")

</div>

I use logstash to store all logs from different nodes in one place. So, I use _ **logback.xml** _ on the node side and logstash udp listener on the other. In logback I use **LogstashSocketAppender** , so as I know I can't set up logs views. On the logstash side I try to parse _@timestamp_ pararm to normal view, but I failed in this. So, I use filter and mutate to add one more same as timestamp param and try to parse it like this

```
 filter {
   mutate {
    add_field => { "logstash_timestamp"=> "%{@timestamp}" }
}  
 date {
match => ["logstash_timestamp1", "YYYY-MM-dd HH:mm:ss"]
tag_on_failure => ["timestamp_parse_failed"]
target => "logstash_timestamp"
}
}

```

How can I correctly get timestamp with my pattern?

This is my logback appender

```
<appender name="stash" class="net.logstash.logback.appender.LogstashSocketAppender">
    <syslogHost>localhost</syslogHost>
    <port>12345</port>
</appender>

```

The result of my parse is: **2018-08-23T11:22:11.863**

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 23, 2018, 6:21pm UTC](https://discuss.elastic.co/t/logstash-timestamp-parse-failed/145713/2 "2018-08-23T18:21:44Z")

</div>

I don't understand. Does the timestamp in `@timestamp` really have the form "YYYY-MM-dd HH:mm:ss"? Why is the date filter set up to parse `logstash_timestamp1`? Did you mean `logstash_timestamp`?

---

<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:** [September 20, 2018, 6:21pm UTC](https://discuss.elastic.co/t/logstash-timestamp-parse-failed/145713/3 "2018-09-20T18:21:47Z")

</div>

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