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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...