Splunk Search

Why using semicolon as multivalue delimiter results in "Unbalanced quotes" error when using the API?

rjdefrancisco
Explorer

The following works fine in the Search app:

 

... | makemv delim=";" hashes | ...

 

The equivalent curl call

 

curl ... -d search="search ... | makemv delim=\";\" hashes | ..." -d output_mode=csv

 

fails with an "Unbalanced quotes" error. 

Delimiters other than ; work fine. I tried to escape the semicolon, use Unicode values, replace the string with a variable, all to no avail. Any suggestions?

Labels (2)
0 Karma
1 Solution

rjdefrancisco
Explorer

I finally solved the problem by replacing the semicolon  with its URL encoding (%3b) inside the curl command:

curl ... -d search="search ... | makemv delim=\"%3b\" hashes | ..." -d output_mode=csv

 

View solution in original post

rjdefrancisco
Explorer

I finally solved the problem by replacing the semicolon  with its URL encoding (%3b) inside the curl command:

curl ... -d search="search ... | makemv delim=\"%3b\" hashes | ..." -d output_mode=csv

 

richgalloway
SplunkTrust
SplunkTrust

How are you escaping the semicolon in the curl command?  I suspect you need to use a shell escape to keep the shell from thinking the ; separates two commands (and makes Splunk think the search is missing a quote).

curl ... -d search="search ... | makemv delim=\"~;\" hashes | ..." -d output_mode=csv
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...