Skip to main content
By default, prismeai-events writes the platform events directly into Elasticsearch or OpenSearch. It can instead push them to Logstash, which forwards them to the same data streams and can also send them, filtered or transformed, to your own tools: a SIEM that only accepts push ingestion, an OpenTelemetry conversion towards an observability platform, etc. The two modes are exclusive: in Logstash mode, prismeai-events no longer writes events into Elasticsearch/OpenSearch itself. It still reads them there (activity, usage, search), and still manages the index templates, lifecycle policies and per-workspace mappings, so it keeps its Elasticsearch/OpenSearch access (EVENTS_STORAGE_ES_*).

How it works

  • Events are pushed by batch (EVENTS_BUFFER_FLUSH_AT / EVENTS_BUFFER_FLUSH_EVERY, as in direct mode) as a JSON array to the Logstash http input.
  • Each event is the exact Prisme.ai JSON document stored today, after the configured preprocessing rules (redaction), with one extra field, prismeai_index, giving the target data stream (one per workspace).
  • The provided pipelines write each event to that data stream with the event id as document id, exactly as the direct mode does. An event pushed twice (e.g. retried after a timeout) is therefore written once, unless the data stream rolled over to a new backing index in between.
  • When Logstash is unreachable, times out or answers 401, 403, 408, 429 or a 5xx status, the batch is retried with an exponential backoff (from 1.5s, ×1.5, capped at 30s) until Logstash accepts it, however long the outage lasts, or until wrong EVENTS_STORAGE_LOGSTASH_USER / EVENTS_STORAGE_LOGSTASH_PASSWORD are fixed.
  • Meanwhile, the platform keeps working and new events wait in prismeai-events memory, up to EVENTS_BUFFER_MAX_PENDING events (50 000 by default): beyond, events are dropped, logged and counted by the events_persistence_dropped_total metric. Size this limit according to your pods’ memory and average event size, keeping room for the events received while a push hangs (up to EVENTS_STORAGE_LOGSTASH_TIMEOUT). The events_persistence_queue_total metric gives the current number of waiting events. Being in memory, waiting events are lost if the prismeai-events pod restarts.
  • Any other error status (400, 413 …) is logged, and the whole batch (up to EVENTS_BUFFER_HIGH_WATERMARK events, 800 by default) is dropped without retry and counted by events_persistence_dropped_total. A proxy between prismeai-events and Logstash that limits the request size (1 MB by default with NGINX Ingress) and answers 413 therefore loses every event.
  • The prismeai-events readiness probe checks Elasticsearch/OpenSearch, not Logstash: monitor Logstash itself, and alert on the events_persistence_requests_failed_total metric as soon as you enable this mode.

Deploy Logstash with the Helm chart

From version 1.14.0, the prismeai-core chart can deploy a Logstash already configured for the platform, and switch prismeai-events to it. It requires platform 27.10.0 or later: an older prismeai-events ignores the Logstash mode and keeps writing directly, without any error. With it, skip Configure prismeai-events and Configure Logstash.
prismeai-core-values.yml
The chart then deploys:
  • a <release>-prismeai-logstash StatefulSet, with one volume per replica for the persistent queue and the dead letter queue;
  • the Prisme.ai pipeline, writing to the Elasticsearch or OpenSearch of global.storage.events (according to its driver) with the prismeai-events credentials;
  • basic auth on the http input, with credentials generated in the <release>-logstash-http-auth Secret and kept across upgrades. When Helm cannot read the cluster (helm template, GitOps), create that Secret yourself and set it in global.storage.events.logstash.existingSecret (user and password keys).
Check these points before enabling it:
  • Port: global.storage.events.url needs an explicit port, even 443, or the chart refuses to render. When the URL comes from global.storage.events.existingSecret, the chart cannot check it.
  • OpenSearch: the chart has no default image. Build one holding the opensearch output plugin, as in the OpenSearch tab of Configure Logstash, and set it in prismeai-logstash.image.repository, plus prismeai-logstash.imagePullSecretName for a private registry. Without it, the chart refuses to render.
  • Private CA: the global.extraCABundle file is mounted in Logstash but not trusted automatically (Java ignores NODE_EXTRA_CA_CERTS): Logstash verifies the Elasticsearch/OpenSearch certificate with the Java CAs. Set global.storage.events.tlsCaFile, e.g. to that file (/etc/ssl/prismeai-extra-ca/ca-bundle.crt with the default mountPath and key), even if prismeai-events works without it. This file then replaces the Java CAs: it must hold the Elasticsearch/OpenSearch one.
  • Proxy: global.proxy does not apply to the output towards Elasticsearch/OpenSearch. If it must go through a proxy, set prismeai-logstash.output.proxy.
  • Least privileges: give Logstash its own user (see Least privileges) with prismeai-logstash.output.existingSecret, and only let prismeai-events reach the http input with prismeai-logstash.networkPolicy.enabled: true.
To add your own outputs, create a ConfigMap holding your pipeline (for instance siem.conf) in the Logstash namespace, then declare it: the chart adds the pipeline output and the pipelines.yml entry.
prismeai-core-values.yml
Setting enabled back to false switches prismeai-events back to direct writes and deletes the StatefulSet: events still in its persistent queue are not written. Check that the queue is empty first: curl -s localhost:9600/_node/stats/pipelines/prismeai-events in each Logstash pod must show queue.events_count at 0. The volumes and the <release>-logstash-http-auth Secret remain: delete them by hand. helm show readme prismeai/prismeai-core lists every value of the chart’s Logstash.

Configure prismeai-events

If you run Logstash yourself (Docker Compose, or Kubernetes without the chart’s Logstash), configure both sides as follows.
prismeai-core-values.yml

Configure Logstash

Prisme.ai provides one pipeline per backend, identical except for their output: they require Logstash 8.x or later. Enable the persistent queue (queue.type: persisted) so that events received by Logstash survive a restart: with several Logstash instances, each one has its own queue. Also enable the dead letter queue: otherwise, documents rejected by Elasticsearch/OpenSearch (e.g. on a mapping conflict) only show up in Logstash logs.
Set ELASTICSEARCH_HOSTS to the cluster prismeai-events reads from (EVENTS_STORAGE_ES_HOST), as a single URL (list several nodes directly in hosts otherwise), and uncomment the credentials if needed. Write the port, even 443: Logstash uses 9200 when the URL has none. If Elasticsearch serves https with a private CA (e.g. deployed with ECK), mount that CA in Logstash and uncomment ssl_certificate_authorities (cacert before Logstash 8.8).
prismeai-events.conf
Do not filter or transform events in this pipeline, and keep the template, lifecycle and data stream management of its output disabled (manage_template, plus ilm_enabled and data_stream with Elasticsearch): the platform reads these documents back as is, and relies on the data streams, templates and lifecycle policies created by prismeai-events. An event that loses its prismeai_index field is written nowhere, without any error.

Least privileges

The http input accepts any event sent to it, which Logstash then writes with its own credentials. Restrict both to what prismeai-events needs:
  • Only let prismeai-events reach the http input (see Network Policies), and enable its basic auth: uncomment user and password in the http input, and set the same credentials in EVENTS_STORAGE_LOGSTASH_USER / EVENTS_STORAGE_LOGSTASH_PASSWORD.
  • Give Logstash its own user, only allowed to write events, rather than the prismeai-events one. With Elasticsearch:
    • cluster privilege monitor, without which Logstash does not start;
    • on ${eventsPrefix}-events-* (see Elasticsearch least privileges), the create_doc index privilege, and auto_configure to create the data stream of a workspace on its first event.
    With OpenSearch, grant the equivalent permissions: reading the cluster information, and creating documents and data streams on the same pattern.
An event Logstash is not allowed to write is retried indefinitely and blocks a pipeline worker: check that the pattern matches the EVENTS_STORAGE_NAMESPACE of prismeai-events.

Add your own outputs

To send events to other tools without altering what is written to Elasticsearch/OpenSearch, use Logstash’s pipeline-to-pipeline “forked path” pattern: the Prisme.ai pipeline sends a copy of each event to your own pipelines, which filter and transform their copy independently.
  1. In prismeai-events.conf, add a pipeline output next to the elasticsearch or opensearch one, inside the if [@metadata][index] block:
  2. Declare your pipeline in pipelines.yml, with its own persistent queue:
    pipelines.yml
  3. Write it, for instance to forward only errors to a SIEM:
    siem.conf
Your pipeline can stop the writes to Elasticsearch/OpenSearch. While your tool is down or slow, the copies pile up in your pipeline’s queue. Once that queue is full, Logstash also blocks the Prisme.ai pipeline (a blocked downstream pipeline blocks the sending pipeline): nothing is written to Elasticsearch/OpenSearch anymore, Logstash rejects or stops answering the pushes, and prismeai-events keeps up to EVENTS_BUFFER_MAX_PENDING events in memory before dropping events, which are then missing from the platform Activity and usage too. Size queue.max_bytes for the longest outage of your tool, and monitor that queue.
Each event has the fields shown in the workspace Activity: id, type, source (workspaceId, userId, correlationId, appSlug …), payload, createdAt, plus @timestamp (equal to createdAt). The target data stream is available as [@metadata][index]. An event pushed twice reaches your outputs twice: deduplicate on id if your tool needs it.

Try it locally

The platform docker-compose.yml ships an optional Logstash service using the Elasticsearch pipeline: