Splunk Search

Extract part of the result

starbac
Explorer

Hello,

I have some data in Splunk server that is separated by semicolon ";"
String1=Int1;String2=Int2;String3=Int3...

How can I do to get only String2=Int2 ?

Tags (1)
0 Karma
1 Solution

vnravikumar
Champion

Hi

Give a try

| makeresults 
| eval msg ="String1=Int1;String2=Int2;String3=Int3" 
| eval temp =split(msg,";") 
| mvexpand temp 
| rex field=temp "(?P<key>.+)=(?P<value>.+)" 
| where key="String2"

View solution in original post

vnravikumar
Champion

Hi

Give a try

| makeresults 
| eval msg ="String1=Int1;String2=Int2;String3=Int3" 
| eval temp =split(msg,";") 
| mvexpand temp 
| rex field=temp "(?P<key>.+)=(?P<value>.+)" 
| where key="String2"
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...