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.

Configure prismeai-events

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: