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
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...