# Set dynamic headers in every request

**URL:** https://discuss.elastic.co/t/set-dynamic-headers-in-every-request/319118
**Category:** Beats
**Tags:** heartbeat
**Created:** [November 16, 2022, 5:07pm UTC](https://discuss.elastic.co/t/set-dynamic-headers-in-every-request/319118 "2022-11-16T17:07:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rbr66](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@rbr66](https://discuss.elastic.co/u/rbr66)
#### Post date: [November 16, 2022, 5:07pm UTC](https://discuss.elastic.co/t/set-dynamic-headers-in-every-request/319118/1 "2022-11-16T17:07:26Z")

</div>

Hi,

We are monitoring a series of machines with heartbeat and we have a special casuistic in which we need heartbeat to send the timestamp in which the request is made, we don't care if by headers, params, or query params.

Is it possible in each execution to add the dynamic timestamp to a header for example? By using javascript or elastic variables. Something like:

```auto
  check.request:
    method: GET
    headers:
        'Content-Type': 'application/json' 
        'X-Heartbeat-Timestamp': {{timestamp}}

```

Regards and thanks in advance.

---

<div class="post-metadata">

### Author: ![jkambic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkambic/32/53306_2.png) [@jkambic](https://discuss.elastic.co/u/jkambic)
#### Post date: [November 17, 2022, 3:46pm UTC](https://discuss.elastic.co/t/set-dynamic-headers-in-every-request/319118/2 "2022-11-17T15:46:17Z")

</div>

Hi @rbr66 - thanks for your interest in Heartbeat.

Heartbeat does not support the type of use case you describe today. That being said, we are [planning](https://github.com/elastic/synthetics/issues/137) to add a feature to our Synthetics agent that will allow this type of flexibility and much more in the future.

Today there's a great deal of flexibility within synthetic browser journeys that allows users to write custom scripts, import frameworks, etc., and this would extend that same flexibility to our lightweight monitors as well.

Have a look at the issue linked, and if you have concerns feel free to make any suggestions. Please let us know if we can provide any further info.

---

<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: [December 15, 2022, 5:46pm UTC](https://discuss.elastic.co/t/set-dynamic-headers-in-every-request/319118/3 "2022-12-15T17:46:43Z")

</div>

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