Splunk Search

Splunk - field extraction

chuck_life09
Path Finder

I need to extract a value from this field and update in my table.

Details.Context = "dgfhgjj <Property Name="Name" VariantType="8">TRIMWorkgroup</Property>"

field_name               irrelevant data            when Name="Name" i want the result value (TRIMWorkgroup) in this case as my field value in new field name called "Service"

Help me with a rex command for this.

Labels (1)
Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @chuck_life09,

let me understand:

when you have Name="Name", you want the string between ">" and "<", if this is your need, please try this:

 

| rex field=Details.Context "Name\=\"Name\"[^\>]+\>(?<your_field>[^\<]+)"

 

you can test the regex at https://regex101.com/r/ainfns/1

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @chuck_life09,

let me understand:

when you have Name="Name", you want the string between ">" and "<", if this is your need, please try this:

 

| rex field=Details.Context "Name\=\"Name\"[^\>]+\>(?<your_field>[^\<]+)"

 

you can test the regex at https://regex101.com/r/ainfns/1

Ciao.

Giuseppe

chuck_life09
Path Finder

thank you so much, it worked ...

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @chuck_life09,

good for you!

Ciao and happy splunking.

Giuseppe

P.S.: Karma Points are appreciated 😉

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!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...