# Metricbeat|Failed to parse api response: invalid ch aracter '#' looking for beginning of value"

**URL:** <https://discuss.elastic.co/t/metricbeat-failed-to-parse-api-response-invalid-ch-aracter-looking-for-beginning-of-value/263436>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [February 5, 2021, 4:25pm UTC](https://discuss.elastic.co/t/metricbeat-failed-to-parse-api-response-invalid-ch-aracter-looking-for-beginning-of-value/263436 "2021-02-05T16:25:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepsingh2103](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepsingh2103/32/83496_2.png) [@sandeepsingh2103](https://discuss.elastic.co/u/sandeepsingh2103)\
**Post date:** [February 5, 2021, 4:25pm UTC](https://discuss.elastic.co/t/metricbeat-failed-to-parse-api-response-invalid-ch-aracter-looking-for-beginning-of-value/263436/1 "2021-02-05T16:25:22Z")

</div>

Metricbeat:  
"version": "7.10.0"

I am trying to use query metricbeat of 'prometheus' module using following config:

```auto
- module: prometheus
  period: 10s
  hosts: ["fluentd:24231"]
  metricsets: ["query"]
  queries:
  - name: "rate_output_buffer"
    path: "/metrics"
    params:
      query: "max_over_time(fluentd_output_status_buffer_total_bytes[1m])"  
In the metricbeat log I see following error:
 "error": {
    "message": "error parsing response from: http://fluentd:24231/metrics?query=max_over_time%28fluentd_output_status_buffer_total_bytes%5B1m%5D%29: Failed to parse api response: invalid character '#' looking for beginning of value"
  }

```

Following is a snippet of metrics available on above configured /metrics endpoint. What am I missing here ?

```auto
# TYPE fluentd_output_status_buffer_total_bytes gauge
# HELP fluentd_output_status_buffer_total_bytes Current total size of stage and queue buffers.
fluentd_output_status_buffer_total_bytes{hostname="eb2be64bd061",plugin_id="out_http-9883",type="file"} 187929.0
# TYPE fluentd_output_status_buffer_stage_length gauge
# HELP fluentd_output_status_buffer_stage_length Current length of stage buffers.
fluentd_output_status_buffer_stage_length{hostname="eb2be64bd061",plugin_id="out_http-9883",type="file"} 1.0
# TYPE fluentd_output_status_buffer_stage_byte_size gauge
# HELP fluentd_output_status_buffer_stage_byte_size Current total size of stage buffers.
fluentd_output_status_buffer_stage_byte_size{hostname="eb2be64bd061",plugin_id="out_http-9883",type="file"} 187929.0
# TYPE fluentd_output_status_buffer_queue_length gauge
# HELP fluentd_output_status_buffer_queue_length Current length of queue buffers.
fluentd_output_status_buffer_queue_length{hostname="eb2be64bd061",plugin_id="out_http-9883",type="file"} 0.0
# TYPE fluentd_output_status_queue_byte_size gauge

```

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [February 8, 2021, 10:29am UTC](https://discuss.elastic.co/t/metricbeat-failed-to-parse-api-response-invalid-ch-aracter-looking-for-beginning-of-value/263436/2 "2021-02-08T10:29:27Z")

</div>

Hi!

Your `path` setting seems to be the issue. You have `/metrics` which is not the right one for the `query` API, it should be `/api/v1/query` or `/api/v1/query_range`.  
Please check the [https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-metricset-prometheus-query.html](https://docs) for more info.

---

<div class="post-metadata">

**Author:** ![sandeepsingh2103](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepsingh2103/32/83496_2.png) [@sandeepsingh2103](https://discuss.elastic.co/u/sandeepsingh2103)\
**Post date:** [February 8, 2021, 5:04pm UTC](https://discuss.elastic.co/t/metricbeat-failed-to-parse-api-response-invalid-ch-aracter-looking-for-beginning-of-value/263436/3 "2021-02-08T17:04:18Z")

</div>

Thanks Mark

---

<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, 2021, 7:04pm UTC](https://discuss.elastic.co/t/metricbeat-failed-to-parse-api-response-invalid-ch-aracter-looking-for-beginning-of-value/263436/4 "2021-03-08T19:04:35Z")

</div>

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