The Simplest Way to Make Elasticsearch and Pulsar Work Like They Should
Integrating elasticsearch and pulsar lets engineering teams stream high-volume event data into searchable indexes in real time. Pulsar acts as the durable message bus. Elasticsearch indexes the incoming payloads for fast analytics and text search. This pairing supports log aggregation. User activity tracking, and daily monitoring. Getting the two systems to work well requires clear rules for login. Schema validation, and network isolation. How authentication and data flow work between elastic
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.
Integrating elasticsearch and pulsar lets engineering teams stream high-volume event data into searchable indexes in real time. Pulsar acts as the durable message bus. Elasticsearch indexes the incoming payloads for fast analytics and text search.
This pairing supports log aggregation. User activity tracking, and daily monitoring. Getting the two systems to work well requires clear rules for login. Schema validation, and network isolation.
How authentication and data flow work between elasticsearch and pulsar
Data moves from Pulsar topics to Elasticsearch indexes through a dedicated sink connector. Producers publish messages to a Pulsar topic. The Pulsar IO framework reads those messages in batches and writes them to the Elasticsearch REST API.
Login happens at two distinct boundaries. First, the sink connector must log in with the Pulsar. Broker to read from the source topic. Teams use token login, mutual TLS, or OAuth2 to verify the connector identity. Pulsar checks that this identity has consume grants on the target namespace or topic.
Second, the sink connector must log in with the Elasticsearch cluster the connector presents an API key or a service account keys over TLS. Elasticsearch verifies the keys and checks that the assigned role allows bulk. Index and write tasks on the destination index.
Schema handling bridges the two platforms. Pulsar enforces structured schemas on topics, such as Avro or JSON. The connector translates those records into JSON documents that match the Elasticsearch index mapping. Keeping schemas strict in Pulsar prevents malformed documents from breaking downstream indexing jobs.
Common failure modes and how to scope roles
Many teams rush the setup and rely on shared admin accounts for the connector pipeline. A single static keys with superuser grants in Elasticsearch creates a major security risk if that keys leaks, an attacker can read or delete every index in the cluster.
Broad network exposure causes similar problems. Placing both clusters on flat internal networks allows any workload to query the search API or publish to topics. Unlogged queries from developer machines or rogue scripts then hit. The production search nodes without oversight.
Elasticsearch Security + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix this, scope every service role to the minimum required actions in Pulsar, grant the connector identity consume rights only on the exact topics it needs to export do not grant produce or admin rights to a sink worker.
In Elasticsearch, create a dedicated role for each sink connector. Limit that role to create and write actions on a exact index pattern. Remove read and delete rights so the ingestion pipeline cannot extract sensitive records or drop tables.
Lock down network paths between the message bus and the search cluster use private subnets and strict firewall rules so only the connector. Workers can reach the Elasticsearch ingestion endpoints. Rotate the connector API keys on a regular schedule and log every login event at both boundaries.
Managing operator access to the pipeline
Automated connectors handle day-to-day ingestion. Engineers still need direct access to debug failed. Deliveries or inspect mappings. Sharing static database passwords or cluster admin tokens among team members breaks auditability. When multiple people use the same role logs cannot show who ran a heavy search query or changed an index setting.
Route human fixing through single identity providers. Shared secrets. Map each engineer to a temporary, scoped role based on their current task. Log every query and admin action against the single user identity. Mask sensitive fields in search results before they reach the client screen.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
How does Pulsar push data into Elasticsearch without losing messages?
The Pulsar sink connector uses acknowledgments to track progress. It only acknowledges a message batch to the Pulsar broker. Elasticsearch confirms the bulk write succeeded.
Should the Pulsar sink connector use basic auth or API keys for Elasticsearch?
Use scoped API keys instead of basic user passwords. API keys are easier to rotate, can carry strict index-level grants do not tie pipeline uptime to a human user account.
How do you prevent bad data from crashing the Elasticsearch sink?
Enable schema validation on the Pulsar topic and configure a dead-letter topic for the sink connector. Messages that fail index mapping checks route to the dead-letter topic for manual review. Blocking the pipeline.
Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.
Related guides
In this post