# Create custom heartbeat index

**URL:** <https://discuss.elastic.co/t/create-custom-heartbeat-index/313793>\
**Category:** Beats\
**Tags:** heartbeat\
**Created:** [September 6, 2022, 12:42pm UTC](https://discuss.elastic.co/t/create-custom-heartbeat-index/313793 "2022-09-06T12:42:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![franckfct](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franckfct/32/81235_2.png) [@franckfct](https://discuss.elastic.co/u/franckfct)\
**Post date:** [September 6, 2022, 12:42pm UTC](https://discuss.elastic.co/t/create-custom-heartbeat-index/313793/1 "2022-09-06T12:42:23Z")

</div>

Hi,  
I'm trying during several days to make custom index in 'heartbeat'.  
The goal is to redirect output for diferrents clients.

Here my main config in /etc/heartbeat/heartbeat.yml

```auto
fields_under_root: true
setup.ilm.enabled: false
ilm.enabled: false
setup.ilm.overwrite: true
setup.template.enabled: false
# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["host:9200"]
  username: "user"
  password: "password"

output.elasticsearch.index: "uptime-%{[tags]}-%{+yyyy.MM.dd}"
setup.template.name: "uptime"
setup.template.pattern: "uptime-*"
setup.template.overwrite: false

```

and here, one of a config file /etc/heartbeat/monitors.d/xxx.yml

```auto
- type: http
  enabled: true
  id: id_name
  name: name
  urls: ["http://172.21.0.5:2007/sap/bc/gui/sap/its/z_wosm/"]
  schedule: "@every 10s"
  tags: "the_tag"

```

In this case, "uptime-%{[tags]}-%{+yyyy.MM.dd}" don't work. I tried with %{[fields.tags]} still KO.

I also tried with add\_fileds but still not working.

Could you please help me, i have read all discuss post, all documentation, there is something i don't understand here.

Thanks

---

<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:** [September 8, 2022, 12:58am UTC](https://discuss.elastic.co/t/create-custom-heartbeat-index/313793/2 "2022-09-08T00:58:34Z")

</div>

Hi @frankmehlhop.com , sorry to hear you're having trouble here.

The good news is there is a way to accomplish this.

The way to do things in Elastic post-8.0 for time-series data is to use data streams instead of indexes. Data streams are like indexes, but with extra features for management and fewer ways to accidentally break them.

The easy way to do this would be to set, per monitor `data_stream.namespace`, per [the docs](https://www.elastic.co/guide/en/beats/heartbeat/current/monitor-options.html#monitor-data-stream).

I'd highly recommend reading our [guide to namespaces](https://www.elastic.co/guide/en/fleet/master/data-streams.html) as well. If you have any Qs let us know!

---

<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, 2022, 2:58am UTC](https://discuss.elastic.co/t/create-custom-heartbeat-index/313793/3 "2022-10-06T02:58:54Z")

</div>

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