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!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...