Why does the replacement @timestamp fail?

The index pattern was created without any timestamp.

filter {
    date {
      match => ["[CreationTime]","yyyy-MM-dd HH:mm:ss.SSS"]
      timezone => "Asia/Shanghai"
      target => "@timestamp"
    }
}
mutate {
  replace => [ "@timestamp", "%{CreationTime}" ]
}

The result is not right.
image

Looks to me like there are two spaces. Try

"yyyy-MM-dd  HH:mm:ss.SSS"

Even if I use "yyyy-MM-dd HH:mm:ss.SSS", it still fails.
@Badger

Your [CreationTime] field does not have a sub-second part. The date filter pattern must exactly match the field. Try

"yyyy-MM-dd  HH:mm:ss"

I have tested it before and it was not successful.

date {
match => ["[CreationTime]","yyyy-MM-dd HH:mm:ss","ISO8601"]
timezone => "Asia/Shanghai"
target => "@timestamp"
}

Is there any way to debug the date plugin?

Try

    date {
        match => ["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd  HH:mm:ss","ISO8601"]
        timezone => "Asia/Shanghai"
        target => "@timestamp"
    }

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