TLDR: my timestamp value is already in UTC, I am trying to prevent elastic from converting it to UTC again.
I am using the JDBC input in logstash to query a SQL server database. When I look at a specific record in SQL Server Management Studio the date is "2021-07-08 15:35:09.057".
Here is my logstash config file
input {
jdbc {
...
statement => "SELECT
[TimeStamp] as parsethis
...
}
}
filter {
mutate {
convert => {
"parsethis" => "string"
}
}
date {
match => ["parsethis", "ISO8601"]
target => "parsedUTC"
timezone => "UTC"
}
date {
match => ["parsethis", "ISO8601"]
target => "parsedEST"
timezone => "EST5EDT"
}
}
In Dev Tools, here is the record:
"_source" : {
"parsethis" : "2021-07-08T19:35:09.057Z",
"parsedEST" : "2021-07-08T19:35:09.057Z",
"parsedUTC" : "2021-07-08T19:35:09.057Z"
}
Notice how the parsedEST and parsedUTC fields above have the exact same value. What I would expect (and what I need) is for one of the values to be 2021-07-08 15:35:09.057 which is the original value in the SQL database.
I understand that elasticsearch wants to store date values in UTC. I don't understand how I am supposed to tell elasticsearch that the value is already in UTC and not to convert it to that again.
Why does this method not work? What is the correct way to address this?