Spread our blog

How to Make Search String Case Sensitive in Splunk

In this post we are going to share how to make search string case sensitive in Splunk. There are two ways by which you can make search string case sensitive :

Process 1:

By the search command in Splunk you can easily make a search string case sensitive. Below we have given the queries :

Query 1:

Find a search string which is in Upper-Case

index=”test” sourcetype=”testlog”
| search CASE(ABHAY)

Result:

sc1

Explanation :

 In the above query test is the index name and sourcetype name is testlog. We have used CASE function with search command to make the search string case sensitive. Here by the search command we are getting only those events where given search string(ABHAY) is in Upper-Case .

****************************************************************************

Query 2:

Find a search string which is in Lower-Case

index=”test” sourcetype=”testlog”
| search CASE(abhay)

Result:

sc2

Explanation :

 In the above query test is the index name and sourcetype name is testlog. We have used CASE function with search command to make the search string case sensitive. Here by the search command we are getting only those events where given search string(abhay) is in Lower-Case .

***********************************************************************************

Process 2:

By the regex command in splunk you can easily make a search string case sensitive. Below we have given the queries :

Query 1:

Find a search string which is in Upper-Case

index=”test” sourcetype=”testlog”
| regex “(?=ABHAY)”

Result:

sc3

Explanation :

In the above query test is the index name and sourcetype name is testlog. With the help of regex command we can perfectly match the search string (ABHAY) which is in Upper-Case . We have used “?” sign for perfect matching. At last we are getting only those events where given search string(ABHAY) is in Upper-Case .

********************************************************************************

You can also know about :  How to Pass Other Value from a Single Value Trellis Visualization?

Query 2:

Find a search string which is in Lower-Case

index=”test” sourcetype=”testlog”
| regex “(?=abhay)”

Result:

sc4

Explanation :

In the above query test is the index name and sourcetype name is testlog. With the help of regex command we can perfectly match the search string (abhay) which is in Lower-Case. We have used “?” sign for perfect matching. At last we are getting only those events where given search string(abhay) is in Lower-Case .

Hope this has helped you in achieving the below requirement without fail :

How to Make Search String Case Sensitive in Splunk

 

Happy Splunking !!

What’s your Reaction?
+1
+1
+1
+1
+1
+1
+1

Spread our blog
Previous articleFishbucket in Splunk
Next articleRe-index your data into Splunk
Passionate content developer dedicated to producing result-oriented content, a specialist in technical and marketing niche writing!! Splunk Geek is a professional content writer with 6 years of experience and has been working for businesses of all types and sizes. It believes in offering insightful, educational, and valuable content and it's work reflects that.

LEAVE A REPLY

Please enter your comment!
Please enter your name here