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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...

Auto-Injector for Everything Else: Making OpenTelemetry Truly Universal

You might have seen Splunk’s recent announcement about donating the OpenTelemetry Injector to the ...