banshee est en développement actif : les collecteurs vont encore changer, et une version que vous publiez demandera sans doute des ajustements. Pour un usage stable, attendez la version 1.0.0.

Examples

banshee/examples-collection/examples/api/

elasticsearch-key

Example: base64.encode for an API key header; the health of an Elasticsearch cluster.

  • example
  • api
  • elasticsearch
  • base64
  • secret
  • http

par banshee1 installation1 version

v1Dernière

Publiée le 27 octobre 2026. First version in this collection.

An API key of Elasticsearch

Elasticsearch accepts an API key in the header Authorization: ApiKey <base64 of id:key>. The collector writes it with base64.encode and reads the health of the cluster, green, yellow or red.

How to read it

  • base64.encode($id . ':' . $key): the bytes of the text in base64, the standard alphabet with its = padding.
  • The key is a variable declared 'secret' => true, so the encoded text is a secret too: anything computed from a secret is one. It goes into a header, never into a value or a message, and only over https://.
  • The answer is not a secret: the key went in a header, not in a body.
  • watch.state raises a warning on yellow (a replica missing) and critical on red (a primary shard missing).

To adapt it

  • OpenSearch with the security plugin takes an account in Basic instead: user= and password= (see examples/protocols/http-get-account).
  • Any API that wants a value in base64 in a header follows the same line.