Fix issue with milliseconds in logs shiped to elastic.
- Set log Timestamp only if missing
Fixes-bug: PROD-36383
Change-Id: I9ac5d0ea79faa6b7ea67c32ec5d80e20fd70c54c
diff --git a/metadata/service/agent/output/filter/common.yml b/metadata/service/agent/output/filter/common.yml
index e59c7d9..4723f19 100644
--- a/metadata/service/agent/output/filter/common.yml
+++ b/metadata/service/agent/output/filter/common.yml
@@ -19,4 +19,4 @@
- name: Hostname
value: ${fluentd:dollar}{ hostname }
- name: Timestamp
- value: ${fluentd:dollar}{ time.strftime('%Y-%m-%dT%H:%M:%S.%N%z') }
+ value: ${fluentd:dollar}{ DateTime.parse(record.fetch("Timestamp", time.strftime('%Y-%m-%dT%H:%M:%S.%N%z'))).strftime('%Y-%m-%dT%H:%M:%S.%N%z') }