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!

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud  In today’s fast-paced digital ...

Observability protocols to know about

Observability protocols define the specifications or formats for collecting, encoding, transporting, and ...

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...