# Invalid JSON somewhere in pipeline

**URL:** <https://discuss.elastic.co/t/invalid-json-somewhere-in-pipeline/174820>\
**Category:** Logstash\
**Created:** [April 1, 2019, 4:17pm UTC](https://discuss.elastic.co/t/invalid-json-somewhere-in-pipeline/174820 "2019-04-01T16:17:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OrangeDog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orangedog/32/4630_2.png) [@OrangeDog](https://discuss.elastic.co/u/OrangeDog)\
**Post date:** [April 1, 2019, 4:17pm UTC](https://discuss.elastic.co/t/invalid-json-somewhere-in-pipeline/174820/1 "2019-04-01T16:17:26Z")

</div>

Can't add multiple categories, but this involves APM as well.

Logs flow `apm-agent-java -> stdout -> journald -> rsyslog -> logstash -> elasticsearch`.  
At the end I end up with a document like this

```
{
  "message": "{\"@version\":\"1\",\"@timestamp\":\"2019-04-01T15:55:28.060841+00:00\",\"type\":\"rsyslog\",\"message\":\"2019-04-01 15:55:28.059 [apm-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 0 seconds (\xB110%)\",\"hostname\":\"my-host\",\"severity\":\"info\",\"facility\":\"daemon\",\"programname\":\"java\",\"procid\":\"29369\",\"msgid\":\"-\"}\n",
  "tags": ["_jsonparsefailure"]
}

```

I assumed it was the `\xB1` but have been unable to reproduce using syslog directly: both `logger '\xB1'` and `logger '±'` end up with correctly-encoded JSON sent to logstash. Perhaps I need to set something in the process that the APM agent is instrumenting?

---

<div class="post-metadata">

**Author:** ![OrangeDog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orangedog/32/4630_2.png) [@OrangeDog](https://discuss.elastic.co/u/OrangeDog)\
**Post date:** [April 1, 2019, 4:18pm UTC](https://discuss.elastic.co/t/invalid-json-somewhere-in-pipeline/174820/2 "2019-04-01T16:18:08Z")

</div>

@felixbarny perhaps?

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [April 1, 2019, 8:00pm UTC](https://discuss.elastic.co/t/invalid-json-somewhere-in-pipeline/174820/3 "2019-04-01T20:00:42Z")

</div>

Hm, it's probably best if we only log ascii characters in the agent... I'll change that.

---

<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:** [April 29, 2019, 8:00pm UTC](https://discuss.elastic.co/t/invalid-json-somewhere-in-pipeline/174820/4 "2019-04-29T20:00:47Z")

</div>

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