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!

OpenTelemetry for Legacy Apps? Yes, You Can!

This article is a follow-up to my previous article posted on the OpenTelemetry Blog, "Your Critical Legacy App ...

UCC Framework: Discover Developer Toolkit for Building Technology Add-ons

The Next-Gen Toolkit for Splunk Technology Add-on Development The Universal Configuration Console (UCC) ...

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...