Getting Data In

What is the strptime-style %-variable that TIME_FORMAT would use for subseconds?

dwaddle
SplunkTrust
SplunkTrust

What is the strptime-style %-variable that TIME_FORMAT would use for subseconds? The docs for props.conf suggest the strptime manpage, but being a time_t (which has only second-level precision) there's no such information there.

Labels (1)
Tags (1)
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

jkat54
SplunkTrust
SplunkTrust

For short:
YYYY-MM-DD = %F
HH:MM:SS = %T

Ex.
TIME_FORMAT=%F %T,%3N

0 Karma

jrodman
Splunk Employee
Splunk Employee

To add detail to gkapanthy's answer, the %3N means you have 3 digits of subseconds (milliseconds) while %6N is microseconds. You could use %9N for nanoseconds (dtrace uses this granularity, for example).

We used system strptime at one point, nowadays we have our own implementation which supports a number of common extensions. All the subsecond conversion strings are equivalent if you specify the number of digits.

Note that our internal datastructures still store the data by the second, which means if you have very very large numbers of events in the same second (eg. hundreds of thousands), there can be some performance issues when having to sort them.

EDIT: matteo points out the bit about _time not containing subseconds was incorrect.

gkanapathy
Splunk Employee
Splunk Employee

2008-04-25 12:34:56.689 -> %Y-%m-%d %H:%M:%S.%3N

12:34:56,789012 -> %H:%M:%S,%6N

http://www.splunk.com/base/Documentation/latest/Admin/Configuretimestamprecognition#Enhanced_strptim...

Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...