Getting Data In

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


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

Splunk Employee
Splunk Employee


For short:


0 Karma

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.

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

Get Updates on the Splunk Community!

Index This | A sphere has three, a circle has two, and a point has zero. What is it?

September 2023 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

Build Scalable Security While Moving to Cloud - Guide From Clayton Homes

 Clayton Homes faced the increased challenge of strengthening their security posture as they went through ...

Mission Control | Explore the latest release of Splunk Mission Control (2.3)

We’re happy to announce the release of Mission Control 2.3 which includes several new and exciting features ...