I have a query that I tested with the WEB GUI and it works:
select regexp_replace("HOST",'^.*\((\S+)\)','$1') FROM services.route WHERE regexp_replace("HOST",'^.*\((\S+)\)','$1') != '???' limit 100;
I would like to send this query to the database as part of a shell script and I think I will be using the http endpoint. problem is I cannot figure out how to handle the special characters and which ones are special characters:
curl -sS -H 'Content-Type: application/json' -X POST '10.10.10.195:4200/_sql' -d '{"stmt":"select regexp_replace(\"HOST\",'^.*\((\S+)\)','$1') FROM services.route WHERE regexp_replace(\"HOST\",'^.*\((\S+)\)','$1') != '???' limit 100"}'
bash: syntax error near unexpected token `('
What characters I should be worried about?
Thanks,