# JSON parse error, original data now in message field {:message=\>"Unexpected character ('\<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\\n at \[Source: (String)

**URL:** https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015
**Category:** Logstash
**Created:** [December 26, 2022, 10:06pm UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015 "2022-12-26T22:06:34Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![shafiwebsphere](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@shafiwebsphere](https://discuss.elastic.co/u/shafiwebsphere)
#### Post date: [December 26, 2022, 10:06pm UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/1 "2022-12-26T22:06:34Z")

</div>

```auto
Same code worked in previous version 7 but i have updated to latest version Elasticsearch logstash and kibana 7.17 , the logstash code is not working and getting error, i have been trying this from 15 days , When i have tested previous version it worked , please help to resolve the issue

[ERROR][logstash.codecs.json][01359] JSON parse error, original
data now in message field {:message=>"Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: (String)\"<html><head><title>Error</title></head><body>Internal Server Error</body></html>\"; line: 1, column: 2]", :exception=>LogStash::Json::ParserError, :data=>"<html><head><title>Error</title></head><body>Internal Server Error</body></html>"}

where i m doing wrong

input {
  http_poller {
   urls => {
    se123 => {
       method => get
        url => "https://**/sitemangr/v1/group/8976789098"
          headers => {
        "Content-Type" => "application/json"
     "Authorization" => "Bearer %{jghjklkhgewsklkjhgescvbnkltrezuikjhfdsxcjhgfv}"
      }
    }
 }
  request_timeout => 60
  schedule => { "every" => "100s"}
  codec => "json"
  metadata_target => "http_poller_metadata"
}
}

output {
    elasticsearch
         {
         user => user
         password =>password
         hosts => ["localhost:9200"]
         index => "iiiii-%{+xxxx.ww}"
         }
         stdout { codec => rubydebug }
        }

```

---

<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: [December 27, 2022, 2:40am UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/2 "2022-12-27T02:40:18Z")

</div>

> [@shafiwebsphere](#):
>
> JSON parse error, original  
> data now in message field

What does your [message] field look like? I suspect the http server, which you expect to be sending you JSON, is in fact sending you HTML, possibly an error message, in which case looking at the contents of the [message] field is your route to a solution.

---

<div class="post-metadata">

### Author: ![shafiwebsphere](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@shafiwebsphere](https://discuss.elastic.co/u/shafiwebsphere)
#### Post date: [December 27, 2022, 3:17am UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/3 "2022-12-27T03:17:26Z")

</div>

```auto

In postman I get json result and in February I used to get the expected result with same logstash code. I am using the same code now getting the error . Does there any changes in new version , what modifications or any changes in syntax in http_poller input configuration?
Please let me know

It is a jboss server

[
    {
        "A": {},
        "B": "543a",
        "C": "Shafi",
        "groupHierarchy": [
            "Market",
            "shafi GmbH",
            "shafi_1-Business",
            "System"
        ],
        "D": [],
        "E": [],
        "F": [],
        "G": {
            "ref": "https://shafi/Manager/v1/groups/9865678909876545678a2b",
            "id": "0987654567892b"
        },
        "H": {
            "ref": "https://shafi/Manager/v1/users?groupid=9987786789865689fe56543a"
        },
        "I": null
    }
]

{
  "_index": "qes-2022.52",
  "_type": "_doc",
  "_id": "EFzyyjbAD9tX",
  "_version": 1,
  "_score": 1,
  "_ignored": [
    "http_poller_metadata.response_headers.content-security-policy.keyword",
    "http_poller_metadata.request.headers.Authorization.keyword"
  ],
  "_source": {
    "@timestamp": "2022-12-27T03:53:49.452Z",
    "message": "<html><head><title>Error</title></head><body>Internal Server Error</body></html>",
    "tags": [
      "_jsonparsefailure"
    ],
    "@version": "1",
    "http_poller_metadata": {
      "host": "shafi-4",
      "code": 500,
      "runtime_seconds": 0.46305500000000005,
      "response_message": "Internal Server Error",
      "name": "se123",

```

---

<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: [December 27, 2022, 5:07am UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/4 "2022-12-27T05:07:56Z")

</div>

> [@shafiwebsphere](#):
>
> "message": "ErrorInternal Server Error",

That may be the problem. Please format your post by editing it, selecting the data (not the text) and clicking on \</\> in the toolbar above the edit panel.

It really matters. Without the \</\> both HTML/XML and special characters will be consumed as markup (bold, italics, etc.). Once we know what the error message is then we may be able to help.

---

<div class="post-metadata">

### Author: ![shafiwebsphere](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@shafiwebsphere](https://discuss.elastic.co/u/shafiwebsphere)
#### Post date: [December 27, 2022, 7:57am UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/5 "2022-12-27T07:57:40Z")

</div>

```auto
This code worked previously and now not working , please tell me the differences in 7.17 and ealrier version , do i need to change anything
input {
  http_poller {
   urls => {
    se12300 => {
       method => get
        url => "https://shafi.de/Manager/v1/group-associations/41bd4a570"
          headers => {
        "Content-Type" => "application/json"
     "Authorization" => "Bearer %{aaaaaaaaaaaaaaaa}"
      }
    }
    se1230000 => {
       method => get
        url => "https://shafi.de/Manager/v1/group-associations/4a1f1737336a"
          headers => {
        "Content-Type" => "application/json"
     "Authorization" => "Bearer %{aaaaaaaaaaaaaaa}"
     }
    }
    se1200399 => {
       method => get
        url => "https://shafi.de/Manager/v1/group-associations/3cac908beb3be"
          headers => {
        "Content-Type" => "application/json"
     "Authorization" => "Bearer %{aaaaaaaaaaaaaa}"
      }
    }
 }
  request_timeout => 60
  codec => "json"
  type => "Http_poller"
  schedule => { "every" => "100s"}
  metadata_target => "http_poller_metadata"
}
}
filter {
   date {
   match => ["timestamp" , "yyyy-MM-dd HH:mm:ss"]
       }
mutate { remove_field => ["A","B","C","D","parent","members","groupType"]
}
}

output {
    elasticsearch
         {
         user => elastic
         password => password
         hosts => ["localhost:9200"]
         index => "we-%{+xxxx.ww}"
         }
         stdout { codec => rubydebug }
        }

```

---

<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: [December 27, 2022, 7:40pm UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/6 "2022-12-27T19:40:37Z")

</div>

> [@shafiwebsphere](#):
>
> `"message": "<html><head><title>Error</title></head><body>Internal Server Error</body></html>",`

OK, so that's HTML, not JSON. Look at the server logs to see what error it had.

---

<div class="post-metadata">

### Author: ![shafiwebsphere](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@shafiwebsphere](https://discuss.elastic.co/u/shafiwebsphere)
#### Post date: [December 27, 2022, 8:21pm UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/7 "2022-12-27T20:21:00Z")

</div>

previously it worked , now its not working with same logstash code

what is the difference in newer version 7.17 in http\_poller plugin

i have used the same code earlier it worked  
what should i do to work to work this code here , please help me

In postman i m getting json result, not getting what to do , no solution

from postman result i took in file and tried but getting same error result

---

<div class="post-metadata">

### Author: ![shafiwebsphere](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@shafiwebsphere](https://discuss.elastic.co/u/shafiwebsphere)
#### Post date: [December 28, 2022, 5:23pm UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/8 "2022-12-28T17:23:04Z")

</div>

please let me know what changes to do in my code to change as html

---

<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: [December 28, 2022, 5:44pm UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/9 "2022-12-28T17:44:04Z")

</div>

We have no way of knowing that. The server is getting an internal error. It probably logs an error message indicating what happened, you need to find that error message.

---

<div class="post-metadata">

### Author: ![shafiwebsphere](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@shafiwebsphere](https://discuss.elastic.co/u/shafiwebsphere)
#### Post date: [December 28, 2022, 9:08pm UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/10 "2022-12-28T21:08:00Z")

</div>

In Server below are the error

ERROR [io.undertow.request] (default task-224) UT005023: Exception handling request to /Manager/v1/group-associations/63d3-1e84-470e-94be-41b: java.lang.IllegalArgumentException: Illegal base64 character 25

at java.base/java.util.Base64$Decoder.decode0(Unknown Source)

---

<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: [December 28, 2022, 9:52pm UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/11 "2022-12-28T21:52:57Z")

</div>

> [@shafiwebsphere](#):
>
> Illegal base64 character 25

The authentication token for Bearer authentication has to be base64 encoded. Apparently the token you are sending is not.

---

<div class="post-metadata">

### Author: ![shafiwebsphere](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@shafiwebsphere](https://discuss.elastic.co/u/shafiwebsphere)
#### Post date: [January 4, 2023, 2:26pm UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/12 "2023-01-04T14:26:44Z")

</div>

Is this bug from logstash in http\_poller in 7.17

---

<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 1, 2023, 2:27pm UTC](https://discuss.elastic.co/t/json-parse-error-original-data-now-in-message-field-message-unexpected-character-code-60-expected-a-valid-value-number-string-array-object-true-false-or-null-n-at-source-string/322015/13 "2023-02-01T14:27:30Z")

</div>

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