Splunk Search

I need to get the State from that output

waruike
Engager

server_state=RUNNING server_health=Component:ServerRuntime State:HEALTH_OK MBean:managed2ReasonCode:[]

this is the snippet that i need to get the state from

I am a beginner in splunk 

Labels (1)
0 Karma
1 Solution

renjith_nair
Legend

Try

|rex field=<your filedname> "State:(?<State>.+?),"

 

Test

|makeresults|eval text="| server_state=RUNNING | server_health=Component:ServerRuntime , State:HEALTH_OK , MBean:managed2, ReasonCode:[]"
|rex field=text "State:(?<State>.+?),"
Happy Splunking!

View solution in original post

0 Karma

renjith_nair
Legend

Try

|rex field=<your filedname> "State:(?<State>.+?),"

 

Test

|makeresults|eval text="| server_state=RUNNING | server_health=Component:ServerRuntime , State:HEALTH_OK , MBean:managed2, ReasonCode:[]"
|rex field=text "State:(?<State>.+?),"
Happy Splunking!
0 Karma

waruike
Engager

I need to extract the field and add it to a table

see here

`index_wls` server=* server_state=* domain=* server_health=* | dedup host,server | table host,server ,server_state, 

now from the State I want to add a Row Status to my table to be like

`index_wls` server=* server_state=* domain=* server_health=* | dedup host,server | table host,server ,server_state, Status

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...