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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...