# Logstash Create pipeline API: \[pipeline\] failed to parse object / json\_parse\_exception

**URL:** <https://discuss.elastic.co/t/logstash-create-pipeline-api-pipeline-failed-to-parse-object-json-parse-exception/339055>\
**Category:** Logstash\
**Created:** [July 24, 2023, 8:51am UTC](https://discuss.elastic.co/t/logstash-create-pipeline-api-pipeline-failed-to-parse-object-json-parse-exception/339055 "2023-07-24T08:51:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [July 24, 2023, 8:51am UTC](https://discuss.elastic.co/t/logstash-create-pipeline-api-pipeline-failed-to-parse-object-json-parse-exception/339055/1 "2023-07-24T08:51:02Z")

</div>

Hello World!

I'm trying to follow this:

> **[Create or update Logstash pipeline API | Elasticsearch Guide \[7.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/logstash-api-put-pipeline.html#logstash-api-put-pipeline-example)**

to duplicate an existing Logstash pipeline, however I'm running into following error:

```auto
% export PIPELINE=$(curl --silent --request GET --insecure "https://elastic:$es_password@localhost:9200/_logstash/pipeline/$pipeline_id")
% echo $PIPELINE | curl --silent --request PUT --insecure "https://elastic:$es_password@localhost:9200/_logstash/pipeline/copy-$pipeline_id?pretty" --header "Content-Type: application/json" --data-binary @-
{
  "error" : {
    "root_cause" : [
      {
        "type" : "x_content_parse_exception",
        "reason" : "[1:276] [pipeline] failed to parse object"
      }
    ],
    "type" : "x_content_parse_exception",
    "reason" : "[1:276] [pipeline] failed to parse object",
    "caused_by" : {
      "type" : "json_parse_exception",
      "reason" : "Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: (org.elasticsearch.common.io.stream.ByteBufferStreamInput); line: 1, column: 285]"
    }
  },
  "status" : 400
}
%

```

Please advise

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 24, 2023, 4:46pm UTC](https://discuss.elastic.co/t/logstash-create-pipeline-api-pipeline-failed-to-parse-object-json-parse-exception/339055/2 "2023-07-24T16:46:21Z")

</div>

> [@alexus](#):
>
> `"Illegal unquoted character ((CTRL-CHAR, code 10)):`

Looks like you have a newline character in the data you are trying to parse as JSON, that needs to be quoted.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 21, 2023, 4:46pm UTC](https://discuss.elastic.co/t/logstash-create-pipeline-api-pipeline-failed-to-parse-object-json-parse-exception/339055/3 "2023-08-21T16:46:54Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
