Splunk Search

How to extract fields depending on log message type?

dotandvir
Engager

Hi,

I have a log file consisting of log entries with the following format:
data time source message_type optional_qualifier param1, param2,...,param_n

The parameters value only (i.e. not of the type name=value). What would be the easiest way to extract parameter number 3 or 4 and assign them to a field?

Dotan

Tags (2)
1 Solution

Raghav2384
Motivator

Several ways to do it. Using Transforms.conf with delim option.
Or use ondemand rex. http://docs.splunk.com/Documentation/Splunk/6.1.4/Admin/transformsconf

View solution in original post

Raghav2384
Motivator

Several ways to do it. Using Transforms.conf with delim option.
Or use ondemand rex. http://docs.splunk.com/Documentation/Splunk/6.1.4/Admin/transformsconf

Raghav2384
Motivator

This is very high level example:
Sample log: 2012-10-20 15:23:59 abc123|cyz234|xaycvbd|sedghyrd|scvbdg|10002345000

In my Transforms.conf, this would be the entry
[MyStanza]
DELIMS = "|"
FIELDS = "F001","F002","F003"
And then,add ref in
Props.conf
[MyFields]
REPORTS-foo = MyStanza.

Results, you should have F001 = abc123, F002=cyz234 and so on....
Hope this is what you're looking for.

Thanks,
Raghav

dotandvir
Engager

Thank you, do you have a step by step process for doing so? I am a bit confused about what needs to be done in what order.

Dotan

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!

Monitoring AI Agents with Splunk Observability Cloud

Let’s say I’m running a travel planning AI app in production. A user asks for three concise hotel options in ...

[Puzzles] Solve, Learn, Repeat: Tiling

This puzzle (first published here) is based on finding groups of tessellated tiles (inspired by floor tiles I ...

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...