Splunk Search

Splunk search for range of characters

dvohra
Explorer

Hi All.. how can I search a range of characters in splunk.. example I want to search name of people whose name starts with A-L but not M-Z

user = [A*-Z*] , can I have something like this ?

Labels (4)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| regex user="^[A-L]"
0 Karma

bowesmana
SplunkTrust
SplunkTrust

You can't use regex in a search command but could do this

 

search ...
| where match(user, "^[A-L]")

 

which will filter only users starting with A-L

 or this

 

search...
    [| makeresults 
    | fields - _time
    | eval user=split("ABCDEFGHIJKL","") 
    | mvexpand user 
    | eval user=user."*" ] 

 

which uses a subsearch which effectively turns the search into

 

search ((user=A* OR user=B* OR user=C*...))

 

0 Karma
Get Updates on the Splunk Community!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...