Splunk Search

Extract string and place in new field

sogeniusio
Path Finder

Trying to extract a string into a new field. A sample of log is as follows:

productName = Special Day Argyle Socks for Men (Special Day Argyle Socks Size 10-13)

| rex "productName\s=\s(?<ProductName>\s[\w\W]+)"

Not sure where to go from here. When I test within regex101, it works just fine. But when I move to Splunk i get nothing.

Update

Added this but now it doesn't stop at a new line

| rex "productName\s=\s(?<ProductName>[\w\W]+\n)"
0 Karma
1 Solution

sogeniusio
Path Finder

Figured it out

| rex "productName\s=\s(?<ProductName>.*)"

View solution in original post

0 Karma

sogeniusio
Path Finder

Figured it out

| rex "productName\s=\s(?<ProductName>.*)"
0 Karma

cpetterborg
SplunkTrust
SplunkTrust

I've changed your comment to an answer. Please accept your answer so that it can be noted as having been answered to your satisfaction. You should earn a badge for doing so as a result. 🙂

0 Karma

sogeniusio
Path Finder

Cheers, Thanks!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...