Splunk Search

How to remove ( \" ) characters from search?

MrIncredible
Explorer

In few logs I can see escape character is also printed. My rex is working fine when i am testing it on regex101.com but when i use the same in Splunk Search, its throwing error. I tried different combination by putting quotes but then different error comes.

Regex: https://regex101.com/r/Nm32kd/2

Splunk error: 

MrIncredible_0-1673333693502.png

 

Labels (3)
0 Karma

MrIncredible
Explorer

@gcuselloThanks for your reply. Its not throwing error now though not extracting eligibiltyStatus field as well.

MrIncredible_0-1673337080499.png

MrIncredible_1-1673337142202.png

 

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @MrIncredible,

please try this regex:

| rex "eligibiltyStatus\\\": \\\"(?<eligibiltystatus>[^\\]+)"

Ciao.

Giuseppe

0 Karma

MrIncredible
Explorer

@gcusello 

error:

MrIncredible_0-1673341534765.png

and if i did some changes (marked in yellow) in regex, not getting error but also not getting desired result:

MrIncredible_1-1673341632786.png

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @MrIncredible,

try to add another backslash to your regex in Splunk:

| rex "eligibiltyStatus\\\": \\\"(?<eligibiltystatus>.*?)\\\"\,\\n"

ciao.

Giuseppe

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...