Splunk Search

Has any one come across hidden Double Quotes (") in a field and how to remove it?

ajdyer2000
Path Finder

Hi.

Has any one come across  hidden Double Quotes (") in a field and how to remove it? (maybe a "sed" regex)

The double quotes don't appear in the Splunk Field or even in an excel csv export.

It only appears when you save the csv as a txt file. 

Apparently Splunk sees it because it adds additional lines in my search.

See below for Excel export and corresponding saved txt 

It looks to be Quoting the contents of the AdminGroup field.  

csv

src_host AdminGroup
computer1 Domain Admins
LocalAdmins

 

Text file

src_host        AdminGroup
computer1 "Domain Admins
                           LocalAdmins"

 

Labels (4)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @ajdyer2000,

you could use a regex like the following (if the values are in a field called "AdminGroup"):

| rex field=AdminGroup "^\"(?<AdminGroup>[^\"]+)\""

Ciao.

Giuseppe

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ajdyer2000,

you could use a regex like the following (if the values are in a field called "AdminGroup"):

| rex field=AdminGroup "^\"(?<AdminGroup>[^\"]+)\""

Ciao.

Giuseppe

0 Karma

ajdyer2000
Path Finder

Thank you  Giuseppe That Worked.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ajdyer2000 ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma
Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

 (view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...