The Simplest Way to Make Elasticsearch and Pulsar Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Running elasticsearch and pulsar together moves real-time event streams into fast search indexes. Pulsar collects messages from apps, and a sink worker writes them to Elasticsearch. This setup lets your team search live logs and events right away. It separates message storage from search tasks so both systems stay fast. You get steady event queues alongside quick text queries. How data and roles flow between elasticsearch and pulsar Data starts when your apps send messages to a Pulsar topic.

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Running elasticsearch and pulsar together moves real-time event streams into fast search indexes. Pulsar collects messages from apps, and a sink worker writes them to Elasticsearch.

This setup lets your team search live logs and events right away. It separates message storage from search tasks so both systems stay fast. You get steady event queues alongside quick text queries.

How data and roles flow between elasticsearch and pulsar

Data starts when your apps send messages to a Pulsar topic. Pulsar stores these messages on disk until a sink worker reads them. The sink worker groups records into batches and sends them to Elasticsearch. Elasticsearch then indexes each batch so users can run search queries.

Both tools need strict log in rules to keep data safe. Pulsar checks client tokens or TLS certificates before an app can read topics. The sink worker uses its own role to read from the source topic. It then uses an API key or user role to write to Elasticsearch.

Network paths between the two clusters must stay locked down. Only the sink worker nodes should reach the Elasticsearch write port. Admin ports on both tools should stay closed to public networks. Encryption in transit protects every batch of events moving across the network.

Common risks with shared keys and broad access

Many teams use one shared admin key for the sink worker. If that key leaks, an attacker can read or delete every index. Broad tokens in Pulsar also let one bad app read all topics. Long-lived keys sit in plain text files on worker nodes for months.

Engineers also log in to both clusters to fix stuck message queues. They often share one strong account to inspect topics or run search queries. When three people use one account, audit logs cannot show who ran a command. Unlogged queries make it hard to track who read sensitive customer records.

Elasticsearch Security + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Live event streams often carry emails, phone numbers, card numbers, or national IDs. Once Pulsar sends these fields to Elasticsearch, any user with read roles finds them. Masking rewrites matched fields in results so raw values do not spread.

Scoping roles and network paths for safer streams

Start by giving each sink worker a narrow role in both systems. In Pulsar, allow the worker to read only the exact topics it needs. In Elasticsearch, allow that key to write only to specific target indexes. Never give a sink worker permission to delete indexes or change cluster rules.

Next, separate machine roles from human roles across your whole team. Engineers should log in with their own identity instead of shared passwords. Map each team group to read-only roles for daily checks on indexes. Grant write roles only when someone must fix a broken stream or index.

Keep clear logs of every query and topic check your team runs. Rotate machine keys often so old secrets cannot hurt your clusters. Check index templates before data flows to make sure field types match. When one bad record blocks a batch, send it to a dead-letter topic.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

How does Pulsar send messages to Elasticsearch?

Pulsar uses a built-in sink connector that reads messages from selected topics. This worker groups messages into batches and writes them to Elasticsearch indexes.

What permissions does the sink worker need in both tools?

It needs consume rights on the source Pulsar topic to read events. In Elasticsearch, it needs write and index rights on the target index.

How do we stop bad records from breaking the data stream?

Set up a dead-letter topic in Pulsar for records that fail indexing. The sink moves bad messages there so valid batches keep flowing without stops.

The query runs. The emails stay hidden.