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!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...