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]+)"
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...