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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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