Splunk Search

What is the regular expression to extract the numbers in my sample?

JoshuaJohn
Contributor

I am trying to get the 432233 extracted into a field called memory

memorythread = "432233 KB";

tried ?(/d)

0 Karma
1 Solution

masonmorales
Influencer

| rex "memorythread = \"(?<memory>\d+)"

View solution in original post

0 Karma

skoelpin
SplunkTrust
SplunkTrust

Try this.. It will create a field called memorythread

... | rex memorythread\s=\s"(?<memorythread>\d+)

0 Karma

masonmorales
Influencer

| rex "memorythread = \"(?<memory>\d+)"

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...