Getting Data In

can I mix extracted and current timestamps when ingesting data?

cphair
Builder

I have a CSV dataset with (only) a year field. I'd like to use the year as a partial timestamp on the events and then use either January 1 12:00 or the current datetime for the rest of the timestamp. Is that possible? I've been playing around with TIME_FORMAT trying things like
%Y/1/1:12:00, but I haven't gotten anything to work yet.

0 Karma

woodcock
Esteemed Legend

You can do this but it takes 2 steps and bloats your events. First you use a SEDCMD to modify your timestamp to add month and day. Then you do your normal stuff. Assuming that the first 4 characters are the year, try this:

SEDCMD-add_January_First_at_Noon = s/^(\d{4})/\1\/1\/1:12:00/
0 Karma

maciep
Champion

Not sure if that's possible. Do you have the ability to change the format of that field to include the date you want? Or add other fields for month/day/time that you could use to build the timestamp?

The TIME_FORMAT setting tells splunk how to identify the timestamp in the event, not what to set it to. Since you only have the year field, it obviously won't find the rest of the timestamp you have in there.

0 Karma

cphair
Builder

Technically I could edit the created file, but there are a bunch like this. I don't have the ability to change the source. There's no other date information in the events.

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...