Splunk Search

How to stop automatic field extraction from creating separate fields for each case variant on the same field name

bmitchell
New Member

I have a log in which variations of case on the fieldname are causing automatic field extraction to create several fields where I would like only 1.

Example:

With entries like the following in the loglines:
requestor_Id=foo
Requestor_ID=bar
requestor_id=zoo

I would like to get only one case insensitive field extracted that collapses them all as "requestor_id"

The automatic field extractor was treating each case variant as a separate field. I setup a saved field extraction that was case insensitive and was able to give me one "good" field extraction that contains all of the data. However, the other case variants for the field name in the logs are still being extracted as well, and that's confusing to users.

Is there a way to tell automatic field extraction to NOT proceed with auto-extracting on the redundant field names (requestor_Id, Requestor_ID) so that only my one case insensitive field extraction called requestor_id is presented?

Thanks in advance!

0 Karma

khodges_splunk
Splunk Employee
Splunk Employee

Or use eval coalesce:

...| eval requestor_id=coalesce(requestor_Id, Requestor_ID, requestor_id)

This function takes an arbitrary number of arguments and returns the first value that is not null.

0 Karma

lguinn2
Legend

One solution would be to use Field Aliasing. You can find it in the Manager under Fields. This won't stop the automatic field extraction, but it will let you use a single common name.

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!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Note: This post outlines a proposed architecture and serves as an interest check. If we secure commitments ...