# Heartbeat No matching indices found for index pattern heartbeat\*

**URL:** https://discuss.elastic.co/t/heartbeat-no-matching-indices-found-for-index-pattern-heartbeat/342345
**Category:** Beats
**Tags:** heartbeat
**Created:** [September 5, 2023, 1:19pm UTC](https://discuss.elastic.co/t/heartbeat-no-matching-indices-found-for-index-pattern-heartbeat/342345 "2023-09-05T13:19:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![BenKenobi](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@BenKenobi](https://discuss.elastic.co/u/BenKenobi)
#### Post date: [September 5, 2023, 1:19pm UTC](https://discuss.elastic.co/t/heartbeat-no-matching-indices-found-for-index-pattern-heartbeat/342345/1 "2023-09-05T13:19:04Z")

</div>

Hi, I have installed and configured heartbeat according your documentation.  
I have created a cfg-file tcpdemo.yml and it looks like this:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/a/2afafca887469d14823dbeb74e04424fbabd1cb0.png)

Elastic and Kibana run on the same cluster and heartbeat is installed on another server (not in the cluster!) What I try is to run a simple test and send the data to elastic/kibana.  
Furthermore I have created a new Kibana user with corresponing rights.

When I run

```auto
heartbeat setup

```

I dont get any errors.  
So I go to Kibana and create an index pattern heartbeat-\* which matches the existing index heartbeat-7.12.7-2023.09.04-000001

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/9/59471f2f1166bcdf9f43d045e928ec7e44a38de3.png)

As you can also see: The heartbeat index has 0 docs! (any idea why?)

But when I go to Observability --\> Uptime I get following error message:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/c/2c531c68b948d5ae9e9d4ba2d7c814878d52f272.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/e/be200a2fb596fc9a84352efe768fb9e107f967a2.png)

What can I do here to solve the issue?  
Thanks a lot in advance

---

<div class="post-metadata">

### Author: ![abdulz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdulz/32/97601_2.png) [@abdulz](https://discuss.elastic.co/u/abdulz)
#### Post date: [September 5, 2023, 11:19pm UTC](https://discuss.elastic.co/t/heartbeat-no-matching-indices-found-for-index-pattern-heartbeat/342345/2 "2023-09-05T23:19:58Z")

</div>

Hi @BenKenobi ,

Thanks for your query.

You seeing the `heartbeat-7.17.12xxxx...` index confirms that your `heartbeat setup` command ran successfully. **Docs count** `0` shows heartbeat hasn't indexed any ping/result document yet.

Let's go through a few steps first to get heartbeat working:

1. A successful execution of the setup command confirms that your heartbeat can connect to ES. You can however additionally confirm it by running `heartbeat test output` and see if everything's OK.
2. Heartbeat needs to be running in order to index results documents to the index. `heartbeat -c <path-to-config>` runs the heartbeat which schedules the monitor runs per their schedule. The config your provided has errors. So

```auto
> heartbeat -c tcpdemo.yml -e // should error out with something like:

 Exiting: ... unknown unit " seconds" in duration "5 seconds" ...

```

because `"@every 5 seconds"` should be `"@every 5s"`. `-e` flag logs the errors in console instead of writing it to the log file. Also note that `timeouts` should be `timeout`. You can see a reference to all the available configuration [here](https://www.elastic.co/guide/en/beats/heartbeat/7.17/heartbeat-reference-yml.html).
3. To test the setup, create a new file with just the following test monitor:

```auto
- type: tcp
  id: test-tcp-monitor
  enabled: true
  name: TCP Test
  schedule: '@every 5m'
  hosts: ["tcpbin.com"]
  ports: [4242]
  timeout: 10s

```

and run via `heartbeat -c <path-to-config.yml> -e`. In case of a failure, the command will exit with some message. In case of a successful run, you should see the first ping logged like (and so on after every scheduled time):

```auto
{"monitoring":{"metrics":{"heartbeat":{"browser":{...},"http":{...},"icmp":{...},"scheduler":{...},"tcp":{"endpoint_starts":1,"endpoint_stops":1,"monitor_starts":1,"monitor_stops":1}}}}}

```

_Note that_ it's recommended to always use the `id` field and have schedule greater than the timeout.
4. Confirm that the **Docs count** has incremented.
5. Visit Uptime app and see if you see the pings listed.
6. Start adding your desired monitors and ensure that `heartbeat -c <path-to-config.yml> -e` doesn't exit with an error.

I am not sure why you are getting "Error fetching index ...". Delete the index pattern that you created manually and go through above steps (or if possible setup a fresh ES instance) and let us know how if you still get the error.

---

<div class="post-metadata">

### Author: ![BenKenobi](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@BenKenobi](https://discuss.elastic.co/u/BenKenobi)
#### Post date: [September 8, 2023, 12:58pm UTC](https://discuss.elastic.co/t/heartbeat-no-matching-indices-found-for-index-pattern-heartbeat/342345/3 "2023-09-08T12:58:52Z")

</div>

Hello @abdulz , Thanks for your great feedback with instructions.

I found the root cause: When starting the service and checking the status, I got the message that  
the cfg file could not be parsed. So I disabled my own yml config file and put the information into the heartbeat.yml monitors inline part.

After restarting the service the error messages disappeared and the index was created.  
Furthermore the index has now docs count greater nil:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/d/1dabb82c4eb0a689c9fd8168ff6f4e9bb2a86f77.png)

What I would like to know is, if it is mandatory to install heartbeat on 1 server i.e. the Elasticsearch server or any other or is it also possible to install heartbeat on every server that shall be monitored?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/2/c20e5981984734086792e34ceb5768d65bc7528d.png)

Thanks

---

<div class="post-metadata">

### Author: ![abdulz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdulz/32/97601_2.png) [@abdulz](https://discuss.elastic.co/u/abdulz)
#### Post date: [September 8, 2023, 2:24pm UTC](https://discuss.elastic.co/t/heartbeat-no-matching-indices-found-for-index-pattern-heartbeat/342345/4 "2023-09-08T14:24:21Z")

</div>

@BenKenobi think of Heartbeat as an observer for measuring the uptime of your application. The goal is to measure uptime from the perspective of the consumers, whether they are end users or other machines.

You don't necessarily need to install Heartbeat on every individual server that you want to monitor. Instead, you should install Heartbeat on observer locations. These observer locations are where Heartbeat will periodically check the status of your servers and services. Multiple Heartbeat instances can write to a single ES for centralized monitoring, alerting and analysis.

If monitoring your application from a single observer location accurately represents its uptime for your use case, then one observer location is sufficient. However, in scenarios where you want to ensure uptime from multiple geographical regions or network segments, you can install Heartbeat on multiple observers to provide a more comprehensive view of your application's availability. To make this as simplest as possible, we introduced the new [Synthetics app](https://www.elastic.co/guide/en/observability/current/synthetics-get-started-ui.html#uptime-set-up-app-add-monitors) where defining and running a monitor from various location around the world is just a few clicks away. Synthetics app also allows you to run monitors from [private servers](https://www.elastic.co/guide/en/observability/current/synthetics-private-location.html#monitor-via-private-agent) while providing the same seamless GUI or project based workflow of defining and managing monitors.

---

<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: [October 6, 2023, 4:25pm UTC](https://discuss.elastic.co/t/heartbeat-no-matching-indices-found-for-index-pattern-heartbeat/342345/5 "2023-10-06T16:25:07Z")

</div>

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