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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...