Filter "Date" not applying to @timestamp

Hi!
Seen a lot of topics about converting date from custom log's strings. None of them helped me.
I have a string like this for example:
2019-04-11 07:36:27.842 - 14292 Information Interceptor Organization protection refreshing was started: .

I had successfully extract date from it with Grok:
(?<mytimestamp>^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3})

But with date filter I cannot send it to target field @timestamp

Here is the filter:

filter {
grok {
match => { "message" => "(?<mytimestamp>^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3})" }
}
date {
locale => "eng-US-POSIX"
match => [ "mytimestamp", "yyyy-MM-dd HH:mm:ss.SSS" ]
timezone => "Europe/Moscow"
}
}

What am I doing wrong?
Elastic and logstash version 6.7.1

Ok! I figured it out. It is because filtered time was in original format (UTC) and it is was far from the time range I selected.
Now I am getting my time into @timestamp.
But still I cannot convert in to my Timezone.
I guess I have to mutate it and after apply timezone - but how to do it right?

Now I resolved the issue with timezone forcly defined it in Date filter as UTC and Kibana do Timezone converting on the fly.
(my log time also comes with UTC, but logstash didn't get it as such :frowning: )
date {
locale => "eng-US-POSIX"
match => [ "time", "yyyy-MM-dd HH:mm:ss.SSS" ]
timezone => "UTC"
}
}

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