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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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