This is correct because Logstash and Elasticsearch requires dates in UTC - they are actually UNIX epoch floating point numbers under the hood.
Note that:
"message" => "2018-04-17T10:04:15.693+0200", shows the message field in its UTF-8 String representation for humans. Under the hood it is "message" => 32 30 31 38 2D 30 34 2D 31 37 54 31 30 3A 30 34 3A 31 35 2E 36 39 33 2B 30 32 30 30, but that is not useful to humans.
"timestamp" => 2018-04-17T08:04:15.693Z shows the timestamp field representation for humans. Under the hood it is "timestamp" => 1523952255.693 but again thats not useful to humans. Instead it shows the human representation in terms of UTC.
The strings "2018-04-17T10:04:15.693+0200" and "2018-04-17T08:04:15.693Z" parse to the same Time instance -> 1523952255.693
The first string is formatted for display to a human in a timezone 2 hours ahead of UTC.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.