Splunk Search

Ignoring Case on field values

DotTest37
Path Finder

Im extracting values on a field with this Reg ex:

<technology[^>]*>(?P<Technology>[^<]+)

It returns different values when uppercase and lowercase,, for example:
Audio
AUDIO
audio

How can I make it ignore the Case?
Thanks guys!!

Tags (2)
0 Karma

bwooden
Splunk Employee
Splunk Employee

Splunk is not case sensitive when it comes to field values so we can extract fields with mixed case and not worry about searching.
In other words, these searches would all return the same results:

technology=Audio
technology=AUDIO
technology=audio

NB: Fields are case sensitive, but the values are not. So these searches would NOT return the same result:

Technology=audio
TECHNOLOGY=audio
technology=audio

For reporting purposes, you may wish to show a consistent value. In this case, we can use the lower() or upper() functions of eval.

This will return audio

technology=AUDIO | eval technology=lower(technology)

This will return Audio

... | eval technology = if(len(technology)>0,upper(substr(technology,1,1)) + lower(substr(technology,2,len(technology))),technology)

carasso
Splunk Employee
Splunk Employee

You can have your regex ignore case with "(?i)" at the beginning of the line.

If your question is about how to have the value normalized to one value, try:

 ... | eval Technology=lower(Technology)
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...