There are a number of ways to handle it. One way is to put your data in a file and reference via -d @myfile.json, another is to unicode escape the single quote by replacing with \u0027.
{"error":{"root_cause":[{"type":"parsing_exception","reason":"[sum] failed to parse field
[script]","line":1,"col":85}],"type":"parsing_exception","reason":"[sum] failed to parse field
[script]","line":1,"col":85,"caused_by":{"type":"illegal_argument_exception","reason":"[script] unknown
field [source], parser not found"}},"status":400}[root@sbcmon ~]#
I don't think this new error has anything to do with single quotes. What version of elasticsearch are you running against? If you replace "source" with "inline" does it work?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.