# Metricbeat HTTP module - request and process headers only

**URL:** <https://discuss.elastic.co/t/metricbeat-http-module-request-and-process-headers-only/233942>\
**Category:** Beats\
**Tags:** beats-module\
**Created:** [May 22, 2020, 6:03pm UTC](https://discuss.elastic.co/t/metricbeat-http-module-request-and-process-headers-only/233942 "2020-05-22T18:03:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adilld](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@adilld](https://discuss.elastic.co/u/adilld)\
**Post date:** [May 22, 2020, 6:03pm UTC](https://discuss.elastic.co/t/metricbeat-http-module-request-and-process-headers-only/233942/1 "2020-05-22T18:03:33Z")

</div>

Hello,  
i'm using metricbeat / elasticsearch / kibana.  
My goal is to know if the server is UP : i'm planning to do a request (HEAD request will be perfect) then process the headers (and filtering them maybe in logstash?) and check f the received response status is 200 ==\> so that means server is UP.

I'm facing some issues with metricbeat configuration file.  
The HTTP module is enabled and has this conf :

```auto
    - module: http
      metricsets:
        - json
      period: 10s
      hosts: ["localhost:3000"]
      namespace: "json_namespace"
      path: "/"
      method: "HEAD"
      response.enabled: true

```

using this conf =\> i got an error.message : unexpected end of JSON input

I think it's because HEAD returns an empty body and parsing an empty body gave this error.

I tried using an other conf :

```auto
  - module: http
    metricsets:
      - json
    period: 10s
    hosts: ["localhost:3000"]
    namespace: "json_namespace"
    path: "/"
    body: ""
    method: "GET"
    response.enabled: true

```

I got this error : invalid character '\<' looking for beginning of value

I think it's because \< is a starting of an html page ! and that could not be parsed in json!

I'm stuck here ! I ll be glad if you can help me figure it out !  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![adilld](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@adilld](https://discuss.elastic.co/u/adilld)\
**Post date:** [May 24, 2020, 2:02am UTC](https://discuss.elastic.co/t/metricbeat-http-module-request-and-process-headers-only/233942/2 "2020-05-24T02:02:51Z")

</div>

I used heartbeat in order to get the status and code of my http requests

---

<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:** [June 21, 2020, 4:02am UTC](https://discuss.elastic.co/t/metricbeat-http-module-request-and-process-headers-only/233942/3 "2020-06-21T04:02:51Z")

</div>

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