Getting Data In

Formatting line breaks and timestamps with props.conf

Lazarix
Communicator

Hi guys,

I'm trying to deal with a specific requirement and I've tried modifying the props.conf to my liking, but I can't get it to do what I'd like it to do.

I have a multi-line event that I'd like parsed as a single event as follows:

Mon Jan 20 16:55:01 GMT 2014
Jan 20 16:54 SCHEDULER.log
Jan 20 16:54 DOWNLOADFROMNZ.log
Jan 20 16:52 UPLOADTONZ.log
Jan 20 16:54 NZJOBLOGGER.log
Jan 20 16:29 ETLPROCESS.log

From the above, the rules would be as follows:

Timestamp would be the first line, always in that format
I would then have the multi-line event below parsed as a single event so that I could table it and show that table
The table columns would be through field extraction as:

Last_Active Filename

My problems are:

I can't get it to parse all of the above as a single event

I can't seem to exclude the timestamp in the first line. The line itself doesn't need to be indexed, only referenced to grab the event timestamp

Does anyone have any ideas how best I can achieve this?

Thanks in advance

Tags (2)
0 Karma
1 Solution

kristian_kolb
Ultra Champion

Something like this ought to work. The "Last_Active" values will be ordinary strings, so don't expect any date-like behaviour, unless you convert it further, e.g. with convert, or strftime/strptime.

props.conf

[your_sourcetype]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n+])\w{3}\s\w{3}
TIME_FORMAT = %a %b %d %H:%M:%S %Z %Y
REPORT-my_extractions

transforms.conf

[my_extractions]
REGEX = (?m)(?<Last_Active>\w+\s\d+\s\d+:\d+)\s+(?<Filename>\S+)[\r\n]*
MV_ADD = true

/K

View solution in original post

0 Karma

kristian_kolb
Ultra Champion

Something like this ought to work. The "Last_Active" values will be ordinary strings, so don't expect any date-like behaviour, unless you convert it further, e.g. with convert, or strftime/strptime.

props.conf

[your_sourcetype]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n+])\w{3}\s\w{3}
TIME_FORMAT = %a %b %d %H:%M:%S %Z %Y
REPORT-my_extractions

transforms.conf

[my_extractions]
REGEX = (?m)(?<Last_Active>\w+\s\d+\s\d+:\d+)\s+(?<Filename>\S+)[\r\n]*
MV_ADD = true

/K

0 Karma

Lazarix
Communicator

Yep, This did exactly what I wanted it to do, apart from it including the first line (the date/time stamp) in the event. It did however make everything one event.

The problem I found after doing this, is that I couldn't table it because the field extractions stopped working. I guess I'll have to go back to a single line for each entry.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...

Global Splunk User Group Events: May + June 2026

Your Splunk Community Awaits: Discover Upcoming User Group Events Worldwide    Staying ahead in the fast-paced ...