Getting Data In

XML Log Line Breaking and Timestamps

skansi
Explorer

Hello, I have a problem I could use some help with.

I need to extract data from a XML log file (entries are labelled ) in Splunk. I have to upload an XML log file, and it uploads as a text string. Here is the XML sample:

<LOG><ENTRY><VRIJEME>2010-08-12T10:38:26</VRIJEME><CC>9369175136276314</CC><IZNOS>6427.91</IZNOS></ENTRY><ENTRY><VRIJEME>1998-06-17T04:13:55</VRIJEME><CC>6675476885047681</CC><IZNOS>72452.87</IZNOS></ENTRY>......</LOG>

I use ISO time (YYYY-MM-DDTHH:MM:SS). This way Splunk automatically recognized the first timestamp in the string. I want to break the text in separate events so that Splunk can take the timestamp from each line.

I tried to add LINE_BREAKER = ([\r\n]*)<ENTRY> (this worked for the non-ISO time, where Splunk did not recognize the timestamp), but Splunk gets stuck at 100%.

Thanks! Cheers!

Tags (2)
1 Solution

somesoni2
Revered Legend

Try something like this in you porps.conf.

[yoursourcetype]
BREAK_ONLY_BEFORE = ([\r\n]*)\<ENTRY\>
NO_BINARY_CHECK = 1
TIME_FORMAT = %Y-%m-%dT%H:%M:%S
TIME_PREFIX = VRIJEME\>

View solution in original post

somesoni2
Revered Legend

Try something like this in you porps.conf.

[yoursourcetype]
BREAK_ONLY_BEFORE = ([\r\n]*)\<ENTRY\>
NO_BINARY_CHECK = 1
TIME_FORMAT = %Y-%m-%dT%H:%M:%S
TIME_PREFIX = VRIJEME\>

skansi
Explorer

I only had to kodify it slightly to

[xmltest2]
LINE_BREAKER = ([\r\n]*)<ENTRY>
NO_BINARY_CHECK = 1
TIME_FORMAT = %Y-%m-%dT%H:%M:%S
TIME_PREFIX = VRIJEME>

skansi
Explorer

Thanks, it worked!

0 Karma

skansi
Explorer

Sorry, the forum ate up the backslashes:
LINE_BREAKER = ([backslashrbackslashn]*)

0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...