# How to authorize heartbeat http urls

**URL:** <https://discuss.elastic.co/t/how-to-authorize-heartbeat-http-urls/192237>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [July 25, 2019, 12:14pm UTC](https://discuss.elastic.co/t/how-to-authorize-heartbeat-http-urls/192237 "2019-07-25T12:14:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priya2](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@Priya2](https://discuss.elastic.co/u/Priya2)\
**Post date:** [July 25, 2019, 12:14pm UTC](https://discuss.elastic.co/t/how-to-authorize-heartbeat-http-urls/192237/1 "2019-07-25T12:14:47Z")

</div>

Hi,

I have installed and configured http url on my heartbeat.yml (Heartbeat version6.3.2). My urls are working fine. Getting the login page. But heartbeat is trying to authorize those urls. I am not getting why? Below is my heartbeat.yml file:

```auto
-------------------------------------------------------------------------------------------------------------------------------------
heartbeat.monitors:
- type: http
  enabled: true

  # List or urls to query
  urls:
    - "http://cicdlax.soltstgroupsgs.abchq-d.openstack.abc.com/Plg"
    - "http://cicdlax.soltstgroupsgs.abchq-d.openstack.abc.com/MP/"
    - "http://cicdlax.soltstgroupsgs.abchq-d.openstack.abc.com/VPD/"
    - "http://cicdlax.soltstgroupsgs.abchq-d.openstack.abc.com/EM/"

  # Optional Authentication Credentials
  username: 'abcboot'
  password: 'Go4thabc'

  check.request:
    method: GET
    headers:
      'Authorization': 'Basic'
  check.response.status: 200
  # Configure task schedule
  schedule: '@every 10s'

  ipv4: true
  ipv6: true
  mode: any

- type: icmp
  name: icmp
  enabled: true
  schedule: '*/5 * * * * * *'
  hosts: ["cicdlax.soltstgroupsgs.abchq-d.openstack.abc.com"]
  ipv4: true
  ipv6: true
  mode: any
  timeout: 16s
#============================== Kibana =====================================

setup.kibana.host: "https://elkquest.unx.abc.com:5602"
setup.kibana.ssl.enabled: true
setup.kibana.ssl.certificate_authorities: ["/install/heartbeatinstall/certnew.cer"]
setup.kibana.ssl.certificate: "/install/heartbeatinstall/certnew.cer"
setup.kibana.ssl.key: "/install/heartbeatinstall/privatekey.pem"

#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  hosts: ["elkquest.unx.abc.com:9200"]
  template.name: "heartbeat"
  template.path: "heartbeat.template.json"
  template.overwrite: true
  output.elasticsearch.index: "heartbeat-*"

----------------------------------------------------------------------------------------------------------------------------------
While the output JSON is like this:

2019-07-25T07:54:37.778-0400 DEBUG [publish] pipeline/processor.go:291 Publish event: {
  "@timestamp": "2019-07-25T11:54:37.766Z",
  "@metadata": {
    "beat": "heartbeat",
    "type": "doc",
    "version": "6.3.2"
  },
  "tcp": {
    "port": 80,
    "rtt": {
      "connect": {
        "us": 175
      }
    }
  },
  "resolve": {
    "host": "cicdlax.soltstgroupsgs.abchq-d.openstack.abc.com",
    "ip": "10.104.81.47",
    "rtt": {
      "us": 301
    }
  },
  "beat": {
    "name": "cicdlax.soltstgroupsgs.abchq-d.openstack.abc.com",
    "hostname": "cicdlax.soltstgroupsgs.abchq-d.openstack.abc.com",
    "version": "6.3.2"
  },
  "host": {
    "name": "cicdlax.soltstgroupsgs.abchq-d.openstack.abccom"
  },
  "type": "monitor",
  "monitor": {
    "scheme": "http",
    "host": "cicdlax.soltstgroupsgs.abchq-d.openstack.abc.com",
    "ip": "10.104.81.47",
    "duration": {
      "us": 11376
    },
    "status": "down",
    "id": "http@http://cicdlax.soltstgroupsgs.abchq-d.openstack.abc.com/EM/",
    "type": "http",
    "name": "http"
  },
  "error": {
    "type": "validate",
    "message": "received status code 401 expecting 200"
  },
  "http": {
    "url": "http://cicdlax.soltstgroupsgs.abchq-d.openstack.abc.com/EM/",
    "response": {
      "status": 401
    },
    "rtt": {
      "validate": {
        "us": 10737
      },
      "content": {
        "us": 72
      },
      "total": {
        "us": 10968
      },
      "write_request": {
        "us": 64
      },
      "response_header": {
        "us": 10664
      }
    }
  }
}

```

Please suggest me any changes.

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [July 25, 2019, 12:32pm UTC](https://discuss.elastic.co/t/how-to-authorize-heartbeat-http-urls/192237/2 "2019-07-25T12:32:09Z")

</div>

The 401 status is coming from your service. Does `curl` work when accessing that service from the same box as heartbeat?

---

<div class="post-metadata">

**Author:** ![Priya2](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@Priya2](https://discuss.elastic.co/u/Priya2)\
**Post date:** [July 26, 2019, 4:55am UTC](https://discuss.elastic.co/t/how-to-authorize-heartbeat-http-urls/192237/3 "2019-07-26T04:55:05Z")

</div>

> [@Priya2](#):
>
> username: 'abcboot'  
> password: 'Go4thabc

Yes, It gives authorization error. But I am passing the authentication credentials as well. It is not taking the credentials I think. Please check the yaml syntax.

---

<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:** [August 23, 2019, 4:55am UTC](https://discuss.elastic.co/t/how-to-authorize-heartbeat-http-urls/192237/4 "2019-08-23T04:55:07Z")

</div>

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