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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...