# Send unparsed JSON as a field to the elasticsearch from logstash

**URL:** <https://discuss.elastic.co/t/send-unparsed-json-as-a-field-to-the-elasticsearch-from-logstash/165069>\
**Category:** Logstash\
**Created:** [January 21, 2019, 2:46pm UTC](https://discuss.elastic.co/t/send-unparsed-json-as-a-field-to-the-elasticsearch-from-logstash/165069 "2019-01-21T14:46:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbonnin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dbonnin/32/106053_2.png) [@dbonnin](https://discuss.elastic.co/u/dbonnin)\
**Post date:** [January 21, 2019, 2:46pm UTC](https://discuss.elastic.co/t/send-unparsed-json-as-a-field-to-the-elasticsearch-from-logstash/165069/1 "2019-01-21T14:46:09Z")

</div>

I have this message log:

`10:49:38,664 INFO (ajp-executor-threads - 156) JAR:SOME_JAR ESB66ID:6648 ISV:2019H01B18 SOL:1 NC:1 SRV:CAHREST001 INPUT:{"someky": "somevalue"}`

And this grok pattern:

`%{TIME:hora} INFO \(ajp-executor-threads - %{NUMBER:thread}\) JAR:%{WORD:jar} ESB66ID:%{NUMBER:esb66id} ISV:%{WORD:isv} SOL:%{NUMBER:sol} NC:%{NUMBER:nc} SRV:%{WORD:service}`

The results of applying the grok filter it's this:

```
{
  "time": [
    "10:49:38,664"
  ],
  "thread": [
    "156"
  ],
  "jar": [
    "SOME_JAR"
  ],
  "esb66id": [
    "6648"
  ],
  "isv": [
    "2019H01B18"
  ],
  "sol": [
    "1"
  ],
  "nc": [
    "1"
  ],
  "service": [
    "CAHREST001"
  ]
}

```

How can I get this result, that is, that the JSON be send as one field; unparsed, to the elasticsearch?

```
{
  "time": [
    "10:49:38,664"
  ],
  "thread": [
    "156"
  ],
  "jar": [
    "SOME_JAR"
  ],
  "esb66id": [
    "6648"
  ],
  "isv": [
    "2019H01B18"
  ],
  "sol": [
    "1"
  ],
  "nc": [
    "1"
  ],
  "service": [
    "CAHREST001"
  ],
  input: [
	{"somekey", "somevalue"}
  ]
}

```

I tried something like this with no success:

`%{TIME:hora} INFO \(ajp-executor-threads - %{NUMBER:thread}\) JAR:%{WORD:jar} ESB66ID:%{NUMBER:esb66id} ISV:%{WORD:isv} SOL:%{NUMBER:sol} NC:%{NUMBER:nc} SRV:%{WORD:service} INPUT:%{DATA:input}`

---

<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:** [January 21, 2019, 3:28pm UTC](https://discuss.elastic.co/t/send-unparsed-json-as-a-field-to-the-elasticsearch-from-logstash/165069/2 "2019-01-21T15:28:49Z")

</div>

> [@dbonnin](#):
>
> %{TIME:hora} INFO (ajp-executor-threads - %{NUMBER:thread}) JAR:%{WORD:jar} ESB66ID:%{NUMBER:esb66id} ISV:%{WORD:isv} SOL:%{NUMBER:sol} NC:%{NUMBER:nc} SRV:%{WORD:service} INPUT:%{DATA:input}

Use INPUT:%{GREEDYDATA:input} instead of INPUT:%{DATA:input}. I do not understand the difference between greedy and lazy well enough to explain why 🙂

---

<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:** [February 18, 2019, 3:28pm UTC](https://discuss.elastic.co/t/send-unparsed-json-as-a-field-to-the-elasticsearch-from-logstash/165069/3 "2019-02-18T15:28:55Z")

</div>

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