Getting Data In

Regex help

SS1
Path Finder

Hi,

I have the below event where i tried to extract field ServerA

Event:

ADMU0509I: The Application Server "serverA" cannot be reached. It appears to be stopped.

Query: source="teststatus"| rex max_match=100 field=_raw "Server\s"(?P<jvm>.*)"\s*cannot\sbe\s(?P<status>.*)"|table jvm,host

Output is showing as "serverA" instead of serverA. I dont want the double quotes, how do i achieve that?

 

0 Karma
1 Solution

493669
Super Champion

@SS1 
You can use backslash before quotes to consider in regex like below-

source="teststatus"| rex max_match=100 field=_raw "Server\s\"(?P<jvm>.*)\"\s*cannot\sbe\s(?P<status>.*)"|table jvm,host

 

 

 

 

If this helps an upvaote will be appreciated!

View solution in original post

SS1
Path Finder

Thanks. This solution worked

0 Karma

493669
Super Champion

@SS1 
You can use backslash before quotes to consider in regex like below-

source="teststatus"| rex max_match=100 field=_raw "Server\s\"(?P<jvm>.*)\"\s*cannot\sbe\s(?P<status>.*)"|table jvm,host

 

 

 

 

If this helps an upvaote will be appreciated!

Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...