Getting Data In

Date and Time Extraction from XML

danurag
Explorer

I would like to update the date and timestamp for an event during indexing.

The data is in the following format:

2012-03-05T18:21:20.533adfafadfsafsdf

The timestamp value is in GMT format and I need to convert it into PDT / PST. Splunk Server runs in PST/PDT.

Would just setting the TIME_FORMAT take care of it or do I need to set the Prefix too?

Tags (1)
0 Karma

Stephen_Sorkin
Splunk Employee
Splunk Employee

You need to set the prefix as well, since TIME_FORMAT will only look at the beginning of the line, by default:

TIME_PREFIX = <timestamp>
TIME_FORMAT = %Y-%m-%dT%T.%Q
TZ = UTC

danurag
Explorer

Thank you Steve. This helped greatly.

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...