# Monitoring several url and setting schedule

**URL:** https://discuss.elastic.co/t/monitoring-several-url-and-setting-schedule/324104
**Category:** Beats
**Tags:** heartbeat
**Created:** [January 27, 2023, 11:41am UTC](https://discuss.elastic.co/t/monitoring-several-url-and-setting-schedule/324104 "2023-01-27T11:41:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ppic](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@ppic](https://discuss.elastic.co/u/ppic)
#### Post date: [January 27, 2023, 11:41am UTC](https://discuss.elastic.co/t/monitoring-several-url-and-setting-schedule/324104/1 "2023-01-27T11:41:13Z")

</div>

Hello,  
I use heartbeat module to monitor http responses, with Elastic v7.17.6.  
I have to monitor several url.  
Do I have to use this syntax :

```auto
heartbeat.monitors:
- type: http
  urls: ["http://url1", "http://url2", "http://url3"]

```

or this one ?

```auto
heartbeat.monitors:
- type: http
    urls:
        - "http://url1"
        - "http://url2"
        - "http://url3"

```

And about the schedule, to test every 5 minutes, can I use : (I couldn't find it in the doc)

```auto
- type: http
  schedule: '@every 5m'

```

Or with the cron syntax, is it: ?

```auto
 - type: http
   schedule: '* */5 * * * *'

```

?  
Thank you for your suggestions

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [January 27, 2023, 4:50pm UTC](https://discuss.elastic.co/t/monitoring-several-url-and-setting-schedule/324104/2 "2023-01-27T16:50:37Z")

</div>

Hi ppic,

Referring to [this old blog post for guidance,](https://www.elastic.co/blog/uptime-monitoring-with-heartbeat-and-the-elastic-stack) , I think you can specify the urls in either format you have provided. [The docs make reference to a list of urls](https://www.elastic.co/guide/en/beats/heartbeat/7.17/monitor-http-options.html#monitor-http-urls), so if you are unsure or want to play safe go with option 1 of the list-based syntax over multiple lines.

On the schedule side, it accepts cron syntax which can be either of the formats you have suggested [as per the documentation](https://www.elastic.co/guide/en/beats/heartbeat/7.17/monitor-options.html#monitor-schedule).

Hope that helps!

---

<div class="post-metadata">

### Author: ![ppic](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@ppic](https://discuss.elastic.co/u/ppic)
#### Post date: [January 27, 2023, 5:13pm UTC](https://discuss.elastic.co/t/monitoring-several-url-and-setting-schedule/324104/3 "2023-01-27T17:13:03Z")

</div>

Hi Carly,

Thank you for your advice, it helps !  
I was used to the crontab like in unix systems, with 5 fields for the period, so I was wondering...  
I will try it monday and tell you.  
Have a good we.

---

<div class="post-metadata">

### Author: ![ppic](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@ppic](https://discuss.elastic.co/u/ppic)
#### Post date: [February 6, 2023, 10:30am UTC](https://discuss.elastic.co/t/monitoring-several-url-and-setting-schedule/324104/4 "2023-02-06T10:30:06Z")

</div>

Hi Carly,

It works as intended. Thanks.  
I have now a new pb : it stopped pinging two days ago, while the windows service continued to work.  
I don't see the pb in the log files.  
I restarted the service and now it pings as expected.  
I will close this topic and post a new one for this pb.

---

<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 6, 2023, 12:30pm UTC](https://discuss.elastic.co/t/monitoring-several-url-and-setting-schedule/324104/5 "2023-03-06T12:30:22Z")

</div>

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