Skip to content

Commit 34cdf26

Browse files
committed
chore: updates the timezone to utc for tcplog receiver
1 parent 28adb68 commit 34cdf26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/collector/otel_collector_plugin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ const (
3333
// 2024-11-06T17:19:24+00:00 ---> Nov 6 17:19:24
3434
// 2024-11-16T17:19:24+00:00 ---> Nov 16 17:19:24
3535
timestampConversionExpression = `'EXPR(let timestamp = split(split(body, ">")[1], " ")[0]; ` +
36-
`let newTimestamp = timestamp matches "(\\d{4})-(\\d{2})-(0\\d{1})T(\\d{2}):(\\d{2}):(\\d{2}).*" ` +
37-
`? date(timestamp).Format("Jan 2 15:04:05") : date(timestamp).Format("Jan 02 15:04:05"); ` +
36+
`let newTimestamp = timestamp matches "(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})([+-]\\d{2}:\\d{2}|Z)" ` +
37+
`? (let utcTime = date(timestamp).UTC(); utcTime.Format("Jan 2 15:04:05")) : date(timestamp).Format("Jan 02 15:04:05"); ` +
3838
`split(body, ">")[0] + ">" + newTimestamp + " " + split(body, " ", 2)[1])'`
3939
)
4040

0 commit comments

Comments
 (0)