Splunk Search

DB connect: how to set quotes around field results

norbert_hamel
Communicator

Hi all,

I am using DB connect to retrieve a list of user accounts from a database.
The extract is running as expected, but the username sometimes contain commas:

Username=Lastname,Firstname

This will cause Splunk to read only the first part of the user name to the field "Username".

Is there a way to place the results of my query in quotes to achieve this:

Username="Lastname,Firstname" ?

Thanks
Norbert

Tags (1)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

Have you tried the multi-line key-value output format?

If all else fails you should be able to specify a manual template as the output format, and include quotes explicitly:

... Username="$user_column$" ...

That may be tedious for a large number of columns of course.

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

Great 🙂
I have converted the comment to an answer so you can mark it as solved.

0 Karma

norbert_hamel
Communicator

Cool, I have used the template, now I have exactly what I was looking for.
Greetings to the north! 🙂

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Have you tried the multi-line key-value output format?

If all else fails you should be able to specify a manual template as the output format, and include quotes explicitly:

... Username="$user_column$" ...

That may be tedious for a large number of columns of course.

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 ...