Create custom heartbeat index

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

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

- 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

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.

I'd highly recommend reading our guide to namespaces as well. If you have any Qs let us know!

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