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!

Building Reliable Asset and Identity Frameworks in Splunk ES

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

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...