Splunk Search

How to extract substring from a string?

abhipatthi
Engager

I have a string in this form:

sub = 13433

cf-ipcountry = US

mail = abc.test@gmail.com

ct-remote-user = testaccount

elevatedsession = N

iss = www.google.com

user-agent = Apache-HttpClient/4.5.8 (Java/1.8.0_322)

I want to extracr iss fields value

I tried this but did not work

| rex max_match=0 field=_raw "\/sub \/user-agent \/(?<temp>.*)"

Labels (4)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Is this the exact string you have in your event? If so, try

| rex "iss = (?<iss>\S+)"

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Is this the exact string you have in your event? If so, try

| rex "iss = (?<iss>\S+)"
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...