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!

New This Month in Splunk Observability Cloud - Metrics Usage Analytics, Enhanced K8s ...

The latest enhancements across the Splunk Observability portfolio deliver greater flexibility, better data and ...

Alerting Best Practices: How to Create Good Detectors

At their best, detectors and the alerts they trigger notify teams when applications aren’t performing as ...

Discover Powerful New Features in Splunk Cloud Platform: Enhanced Analytics, ...

Hey Splunky people! We are excited to share the latest updates in Splunk Cloud Platform 9.3.2408. In this ...