Getting Data In

Parsing time_format with random words between date and time

bobmacks
Explorer

Hi,

I'm attempting to extract data and time from a custom text file where date and time are split across two lines and contains two different combination of words in between them. A sample data I'm trying to ingest looks like...

PAGE 1    20-02-2019
ABC       08.03.45
data....

PAGE 2    20-02-2019
DEF       08.50.12
data....

The TIME_PREFIX is pretty straightforward but I'm stuck with how to define TIME_FORMAT to handle the inconsistent characters (i.e. ABC vs DEF) between the date and time fields.

 TIME_PREFIX=^DATE\s{1}\d{1}\s{4}
 TIME_FORMAT=%d-%m-%Y%n???       %H.%M.%S
Tags (1)

integratorz
Path Finder

@bobmacks for TIME_PREFIX, I don't see where the string DATE exists in your sample data. Is this the case?

0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk Observability Cloud – June 2025

What’s New in Splunk Observability Cloud – June 2025 We are excited to announce the latest enhancements to ...

Almost Too Eventful Assurance: Part 2

Work While You SleepBefore you can rely on any autonomous remediation measures, you need to close the loop ...

Leveraging Detections from the Splunk Threat Research Team & Cisco Talos

 Stay ahead of today’s evolving threats with the combined power of the Splunk Threat Research Team (STRT) and ...