Splunk Search

splunk queries to insert special characters in field values

splunker12er
Motivator

How to insert apostrophes in all field values

Results:

group         count
10.243.200.14   1
10.243.200.29   1
10.243.200.67   1

expected o/p:

 group          count
"10.243.200.14" 1
"10.243.200.29" 1
"10.243.200.67" 1
Tags (1)
0 Karma

woodcock
Esteemed Legend

There are a kazillion ways to do it:

... | rex mode=sed field=group "s/(.*)/\"\1\"/"
0 Karma

fdi01
Motivator

see answers of jeffland above it ok or
you can also try like :

....| eval group="\""+group+"\""

jeffland
SplunkTrust
SplunkTrust

If you want them to be in the data (i.e. for later csv export or further calculations), you can add quotes like this:

your search | eval group="\"".group."\""

Keep in mind that this changes the actual value of your field. If you simply want to display quotes around your fields in the table, use fieldformat:

your search | fieldformat group="\"".group."\""

This will only change how your data is rendered in the table, not the actual field values.

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...