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!

What's New in Splunk Enterprise 9.4: Features to Power Your Digital Resilience

Hey Splunky People! We are excited to share the latest updates in Splunk Enterprise 9.4. In this release we ...

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

SignalFlow: What? Why? How?

What is SignalFlow? Splunk Observability Cloud’s analytics engine, SignalFlow, opens up a world of in-depth ...