Getting Data In

Timezone change TZ not working.

knalla
Path Finder

Hi,

We are getting logs in UTC format, I tried using TZ=UTC on Heavy forwarder, but its not working for all events.

Working events:
_time Event_Timestamp
2019-07-26 08:25:44.000 2019-07-26T13:24:43.3570000Z
2019-07-26 07:21:45.000 2019-07-26T12:20:42.0070000Z

Not working:
_time Event_Timestamp
2019-07-26 07:04:06.417 2019-07-26T07:04:06.4170000Z
2019-07-26 07:03:06.293 2019-07-26T07:03:06.2930000Z

Any suggestions?

Tags (1)
0 Karma
1 Solution

woodcock
Esteemed Legend

Do not set TZ with TZ=, set it with:

TIME_PREFIX = ^\d+\-\d+\-\d+\s+\d+:\d+:\d+\.\d+\s+
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%7N%Z

View solution in original post

0 Karma

woodcock
Esteemed Legend

Do not set TZ with TZ=, set it with:

TIME_PREFIX = ^\d+\-\d+\-\d+\s+\d+:\d+:\d+\.\d+\s+
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%7N%Z
0 Karma

richgalloway
SplunkTrust
SplunkTrust

What are your TIME_PREFIX and TIME_FORMAT settings?

---
If this reply helps you, Karma would be appreciated.
0 Karma

knalla
Path Finder

nothing, just added TZ=UTC for source type.

0 Karma

knalla
Path Finder

Do I need TIME_PREFIX and TIME_FORMAT?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You don't need TIME_PREFIX and TIME_FORMAT, but it's a Best Practice to use both.
There's no need for the escape characters in TIME_PREFIX.
TIME_FORMAT should include the time zone indicator. %Y-%m-%dT%H:%M:%S.%7N%Z

---
If this reply helps you, Karma would be appreciated.
0 Karma

knalla
Path Finder

Added these in props.conf

TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%3N
TIME_PREFIX = \"TimeStamp\": \"
TZ = UTC

0 Karma
Get Updates on the Splunk Community!

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...

Auto-Injector for Everything Else: Making OpenTelemetry Truly Universal

You might have seen Splunk’s recent announcement about donating the OpenTelemetry Injector to the ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...