Skip to content

Commit d09f939

Browse files
committed
fix logging test
1 parent 3a6482e commit d09f939

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • rust/operator-binary/src/controller/build/product_logging

rust/operator-binary/src/controller/build/product_logging/vector.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ transforms:
5050
5151
timestamp_string, err = string(event.timestamp)
5252
if err == null {
53-
parsed_timestamp, err = parse_timestamp(timestamp_string, "%Y-%m-%dT%H:%M:%S,%3fZ")
53+
# OpenSearch 3.4.0 uses log4j2 2.21.0 which renders the timezone using "Z" (Zulu).
54+
# OpenSearch 3.6.0 uses log4j2 2.25.0 which renders the timezone as a numeric offset (e.g. "...,122+0000").
55+
# Try the offset format first and fall back to the literal "Z" so both layouts are parsed.
56+
parsed_timestamp, err = parse_timestamp(timestamp_string, "%Y-%m-%dT%H:%M:%S,%3f%z")
57+
if err != null {
58+
parsed_timestamp, err = parse_timestamp(timestamp_string, "%Y-%m-%dT%H:%M:%S,%3fZ")
59+
}
5460
if err == null {
5561
.timestamp = parsed_timestamp
5662
} else {

0 commit comments

Comments
 (0)