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!

Index This | Divide 100 by half. What do you get?

November 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Stay Connected: Your Guide to December Tech Talks, Office Hours, and Webinars!

❄️ Celebrate the season with our December lineup of Community Office Hours, Tech Talks, and Webinars! ...

Splunk and Fraud

Watch Now!Watch an insightful webinar where we delve into the innovative approaches to solving fraud using the ...