# GROK Expression Invalid JSON

**URL:** <https://discuss.elastic.co/t/grok-expression-invalid-json/296603>\
**Category:** Elasticsearch\
**Tags:** ingest-pipeline\
**Created:** [February 8, 2022, 1:32pm UTC](https://discuss.elastic.co/t/grok-expression-invalid-json/296603 "2022-02-08T13:32:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesm1](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jamesm1](https://discuss.elastic.co/u/jamesm1)\
**Post date:** [February 8, 2022, 1:32pm UTC](https://discuss.elastic.co/t/grok-expression-invalid-json/296603/1 "2022-02-08T13:32:06Z")

</div>

Hello - I am attempting to create a GROK expression for an APACHE log. I have gotten the expression working in the GROK debugger and other tools - However when i try to add it in as a line into the Ingestion Pipeline i get the message back that its invalid JSON.

Please can someone tell me where i am going wrong with this ☹

```auto
%{IPORHOST:source.IP} %{DATA:logname}? %{DATA:username}? \[%{HTTPDATE:apache.access.time}\] \\"%{WORD:http.request.method} %{DATA:http.request.header}\\" %{NUMBER:http.response.status_code:long} (?:%{NUMBER:http.response.body.bytes:long}|-) \\("%{DATA:http.request.referrerurl}\\") \\"%{DATA:user_agent.original}\\"? CF-Ray: %{WORD:http.response.CFRayID}?

```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [February 8, 2022, 1:39pm UTC](https://discuss.elastic.co/t/grok-expression-invalid-json/296603/2 "2022-02-08T13:39:40Z")

</div>

Can you share the full pipeline plus an example document? Best would be to share the Simulate Pipeline API as it is a breeze for others to reproduce your problem.. See [Simulate pipeline API | Elasticsearch Guide [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/simulate-pipeline-api.html)

---

<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:** [March 8, 2022, 1:40pm UTC](https://discuss.elastic.co/t/grok-expression-invalid-json/296603/3 "2022-03-08T13:40:28Z")

</div>

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