# Heartbeat - howto configure body & check.request with password in keystore file

**URL:** <https://discuss.elastic.co/t/heartbeat-howto-configure-body-check-request-with-password-in-keystore-file/240917>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [July 13, 2020, 7:50am UTC](https://discuss.elastic.co/t/heartbeat-howto-configure-body-check-request-with-password-in-keystore-file/240917 "2020-07-13T07:50:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuelg75](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Samuelg75](https://discuss.elastic.co/u/Samuelg75)\
**Post date:** [July 13, 2020, 7:50am UTC](https://discuss.elastic.co/t/heartbeat-howto-configure-body-check-request-with-password-in-keystore-file/240917/1 "2020-07-13T07:50:05Z")

</div>

Hello everybody,

Il use heartbeat to check some web site with check.request.  
For example :

```auto
- type: http
  urls: [http://localhost:5050/myweb/app]
  schedule: '@every 1m'
  response.include_body_max_bytes: 10240
  check.request:
    method: POST
    headers: 
        'Content-Type': 'application/x-www-form-urlencoded'
    # urlencode the body:
    body: 'log=LOGIN&pwd=XXXXXXXX&component=$Form&page=Login&service=direct&If=F&submitmode=&submitname='
  check.response:
    status: 200
    body:
    - ControlText

```

This is work fine but it's not too secure to save login and password in config file.  
So I store them in keystore file.  
But, when I try to update my config file to use variables instead of login/password, I have error message.

New config with variable

```auto
- type: http
  urls: [http://localhost:5050/myweb/app]
  schedule: '@every 1m'
  response.include_body_max_bytes: 10240
  check.request:
    method: POST
    headers: 
        'Content-Type': 'application/x-www-form-urlencoded'
    # urlencode the body:
    body: 'log=${LOGIN}&pwd=${PWD}&component=$Form&page=Login&service=direct&If=F&submitmode=&submitname='
  check.response:
    status: 200
    body:
    - ControlText

```

Error message :  
Error creating runner from config: job err can not convert 'object' into 'string' accessing 'check.request.body'

I try multiple configuration to solve this problem without any success.

If someone could help me ...

Samuel

---

<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 10, 2020, 9:50am UTC](https://discuss.elastic.co/t/heartbeat-howto-configure-body-check-request-with-password-in-keystore-file/240917/2 "2020-08-10T09:50:06Z")

</div>

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