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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...