Invalid character 'A' looking for beginning of value

hello,

i am trying to replicate below 'curl' query with metricbeat http module. as you see below, 127.0.0.1:8088 opens and responds well as below.

$ curl -XGET http://127.0.0.1:8088
Active connections: 5
server accepts handled requests
 35 35 134
Reading: 0 Writing: 2 Waiting: 3

to real time monitoring with metricbeat, i set metricbeat configuration as below.

metricbeat.modules:
- module: http
  metricsets:
    - json
  period: 10s
  namespace: "nginx"
  hosts: ["127.0.0.1:8088"]
#  path: "/"
  method: "GET"
output.kafka:
  version: 0.10.2.1
  enabled: true
  # initial brokers for reading cluster metadata
  hosts: ["kfk-01:9092"]
  # message topic selection + partitioning
  topic: 'http_mon'

but the result from kafka says as below.

{"@timestamp":"2019-07-15T07:27:36.545Z","@metadata":{"beat":"metricbeat","type":"doc","version":"6.7.1","topic":"http_mon"},"event":{"dataset":"http.json","duration":354214},"error":{"message":**"invalid character 'A' looking for beginning of value"**},"host":{"name":"csl-01"},"metricset":{"name":"json","module":"http","host":"127.0.0.1:8088","rtt":354}}

is my metricbeat configuration wrong? please advise.

thank you!

Hi @jasony,

The http module at this moment can only collect information from JSON responses, this is done with the json metricset you are using.
Can this service respond in JSON format?

No it responds in text format. I will change the response format to json then.

Thank you for your advise. :slight_smile:

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