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 😉

Get Updates on the Splunk Community!

AI for AppInspect

We’re excited to announce two new updates to AppInspect designed to save you time and make the app approval ...

App Platform's 2025 Year in Review: A Year of Innovation, Growth, and Community

As we step into 2026, it’s the perfect moment to reflect on what an extraordinary year 2025 was for the Splunk ...

Operationalizing Entity Risk Score with Enterprise Security 8.3+

Overview Enterprise Security 8.3 introduces a powerful new feature called “Entity Risk Scoring” (ERS) for ...