banshee is under active development: collectors will keep changing, and a version you publish will likely need adjustments. For stable use, wait for version 1.0.0.

Examples

banshee/examples-collection/examples/protocols/

http-post

Example: http.post with a JSON body built by json.write; errors counted in a search index.

  • example
  • protocol
  • http
  • post
  • json
  • elasticsearch

by banshee1 installation1 version

v1Latest

Published on October 27, 2026. First version in this collection.

Protocol: http.post

http.post sends a POST with a body, a text, and returns what http.get returns. Here, the count of the errors logged in the last 15 minutes, asked to an Elasticsearch or OpenSearch index.

How to read it

  • json.write builds the JSON body from arrays: the quotes, the @ and the nesting are written for you.
  • headers=array('Content-Type' => 'application/json'): the type of the body is a header the author writes.
  • What a POST does on the target is the author's judgement: this one only counts. Use an account that can only read.
  • A body that carries a secret makes the whole answer a secret, but its code and its time (see examples/api/backup-jobs).

To adapt it

  • The address names the index (logs-*) and _count; change the query for the field and the value your logs use.
  • An account: user=, password= (see examples/protocols/http-get-account).