Knowledge Management

Case Sensitivity in eventtype searches

gpburgett
Splunk Employee
Splunk Employee

I want to make a group/eventtype with events from a certain sourcetype where LOGINID="I*" and 'I' is capital only. There are some solutions for case sensitivity up on answers already, but they all involve piping to a function or regex. And when you go to make an eventtype Splunk does not accept search queries with pipes. What can I do to make this search case-sensitive?

0 Karma
1 Solution

Stephen_Sorkin
Splunk Employee
Splunk Employee

You can create a field extraction that uses the case sensitivity of regexes to create a new field only if the first character is uppercase or lowercase. For example:

SOURCE_KEY = LOGIN_ID
REGEX = (?<LOGIN_ID_UPPER>[A-Z].*)

Note that this relies on LOGIN_ID being a regex extracted field, since automatically extracted fields are processed after regex fields.

View solution in original post

0 Karma

Stephen_Sorkin
Splunk Employee
Splunk Employee

You can create a field extraction that uses the case sensitivity of regexes to create a new field only if the first character is uppercase or lowercase. For example:

SOURCE_KEY = LOGIN_ID
REGEX = (?<LOGIN_ID_UPPER>[A-Z].*)

Note that this relies on LOGIN_ID being a regex extracted field, since automatically extracted fields are processed after regex fields.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...