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!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...