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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...