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!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...