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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...