Splunk Search

Help to extract other than numbers

paullt12345
Explorer

Hi

I need help to extract other than numbers from a string

Ex:
test34565
test.xyw2345
test-abc53243

Output

test
test.xyw
test-abc

Tags (2)
0 Karma
1 Solution

vnravikumar
Champion

Hi

Try like

| makeresults 
| eval msg="sample-abc53243" 
| rex field=msg "(?P<output>[^\d]+)"

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi paullt12345,
try something like this

 | makeresults 
 | eval msg="sample-abc53243" 
 | rex field=msg "(?<my_field>\D+)"

You can test it at https://regex101.com/r/r8jYBl/1

Bye.
Giuseppe

0 Karma

vnravikumar
Champion

Hi

Try like

| makeresults 
| eval msg="sample-abc53243" 
| rex field=msg "(?P<output>[^\d]+)"
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...