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,429or a5xxstatus, 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 wrongEVENTS_STORAGE_LOGSTASH_USER/EVENTS_STORAGE_LOGSTASH_PASSWORDare fixed. - Meanwhile, the platform keeps working and new events wait in
prismeai-eventsmemory, up toEVENTS_BUFFER_MAX_PENDINGevents (50 000 by default): beyond, events are dropped, logged and counted by theevents_persistence_dropped_totalmetric. Size this limit according to your pods’ memory and average event size, keeping room for the events received while a push hangs (up toEVENTS_STORAGE_LOGSTASH_TIMEOUT). Theevents_persistence_queue_totalmetric gives the current number of waiting events. Being in memory, waiting events are lost if theprismeai-eventspod restarts. - Any other error status (
400,413…) is logged, and the whole batch (up toEVENTS_BUFFER_HIGH_WATERMARKevents, 800 by default) is dropped without retry and counted byevents_persistence_dropped_total. A proxy betweenprismeai-eventsand Logstash that limits the request size (1 MB by default with NGINX Ingress) and answers413therefore loses every event. - The
prismeai-eventsreadiness probe checks Elasticsearch/OpenSearch, not Logstash: monitor Logstash itself, and alert on theevents_persistence_requests_failed_totalmetric 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.
- Elasticsearch
- OpenSearch
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
Least privileges
The http input accepts any event sent to it, which Logstash then writes with its own credentials. Restrict both to whatprismeai-events needs:
-
Only let
prismeai-eventsreach the http input (see Network Policies), and enable its basic auth: uncommentuserandpasswordin thehttpinput, and set the same credentials inEVENTS_STORAGE_LOGSTASH_USER/EVENTS_STORAGE_LOGSTASH_PASSWORD. -
Give Logstash its own user, only allowed to write events, rather than the
prismeai-eventsone. With Elasticsearch:- cluster privilege
monitor, without which Logstash does not start; - on
${eventsPrefix}-events-*(see Elasticsearch least privileges), thecreate_docindex privilege, andauto_configureto create the data stream of a workspace on its first event.
- cluster privilege
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.-
In
prismeai-events.conf, add apipelineoutput next to theelasticsearchoropensearchone, inside theif [@metadata][index]block: -
Declare your pipeline in
pipelines.yml, with its own persistent queue:pipelines.yml -
Write it, for instance to forward only errors to a SIEM:
siem.conf
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 platformdocker-compose.yml ships an optional Logstash service using the Elasticsearch pipeline: