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!

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...

Splunk Developers: Construct Your Future at the .conf26 Builder Bar

Calling all Splunk architects, platform admins, and app developers: the site is open, and the blueprints are ...

Quick connection discovery mode for forwarders

When a Splunk forwarder loses connectivity to its indexers, it does not always reconnect immediately. In many ...