Security Operations
Updated 13 min read

Self-Hosted SIEM with OpenSearch: An Honest Build Guide

60%
Typical licensing savings vs commercial SIEM
0.5
FTE minimum for production cluster ops
30GB
Recommended max shard size for search
Heap to data ratio rule of thumb

SponsoredRetool

Retool's new app builder is where AI-generated code ships safely

Building apps with AI is easy. Getting them to production safely is another story.

Start building for free today

Commercial SIEM pricing has reached a point where mid-sized teams routinely receive renewal quotes that exceed their entire detection engineering payroll. OpenSearch and Elasticsearch promise a way out: an open-source indexing layer, a mature visualization tool, alerting plugins, and a healthy ecosystem of community detection content. The promise is real. So is the operational tax.

This guide is a sober walk through what it actually takes to build, run, and maintain a self-hosted log pipeline as a working SIEM. We cover when the trade makes sense, how to architect for security workloads specifically, how to do detection engineering at scale on this stack, and the operational costs that the marketing decks do not surface. The audience is a security engineering lead deciding whether to commit, and a SOC architect who has already committed and needs the build to survive contact with production.

The honest answer is that this stack works extremely well when the team is mature, and quietly fails when it is not. Read the operational section before you sign the migration plan.

When Self-Hosted Beats Commercial and When It Does Not

The case for self-hosting is strongest under four conditions, in roughly this order. First, your team has demonstrated operational maturity running stateful distributed systems. If you do not have engineers who can debug a JVM heap dump, diagnose a stuck shard relocation, or restore a snapshot under pressure, the savings will evaporate into incident toil. Second, your licensing math has crossed the line where the savings genuinely pay for the headcount, generally above the one to two million dollar annual SIEM line item depending on region. Below that threshold the math is rarely favorable once you fully load engineer time. Third, you have a compliance or data residency requirement that constrains where data can land; self-hosting in your own VPC sidesteps a long vendor review. Fourth, you have a customization need the commercial tool genuinely cannot meet: extreme retention, unusual data shapes, or programmatic integration with internal platforms. Conversely, if your team is small, your detection content is mostly vendor-provided, your retention needs are modest, and you would rather buy outcomes than build them, a commercial SIEM is the rational choice. The worst outcome is a self-hosted build owned by a team that wanted to buy and was told to build.

Reference Architecture for Security Workloads

A production-grade architecture has five layers. Collection: Fluent Bit on every endpoint or syslog forwarder, with Logstash reserved for sources that need heavy parsing. Fluent Bit is dramatically lighter and easier to operate at fleet scale. Buffering: Kafka between collection and indexing, partitioned by source type, with retention of at least 72 hours. Kafka is non-negotiable for any cluster taking more than a few thousand events per second; it absorbs ingest spikes, decouples failure domains, and gives you replay capability when a parsing change requires reprocessing. Indexing: a hot tier of three or more data nodes on NVMe with dedicated master nodes, a warm tier on cheaper storage for older indices, and optional cold or frozen tiers backed by S3 for compliance retention. Visualization: OpenSearch Dashboards, with role-based access tied to your identity provider via SAML or OIDC. Detection: OpenSearch Alerting plugin for per-document and bucket-level monitors, with ElastAlert2 layered on for use cases the native plugin handles poorly such as cardinality and spike rules. Wrap the whole thing in infrastructure as code, ideally Terraform for cluster provisioning and a configuration management tool for cluster settings. Treat the cluster as cattle, not pets; you will rebuild it during major version upgrades and you do not want to rediscover its configuration each time.

Free daily briefing

Briefings like this, every morning before 9am.

Threat intel, active CVEs, and campaign alerts, distilled for practitioners. 50,000+ subscribers. No noise.

Index Design and Data Lifecycle

Index design is where most self-hosted SIEMs silently degrade. Use data streams or rollover aliases rather than time-based index names; the alias indirection lets you change shard counts and mappings without breaking queries. Target shard size between 10 and 30 gigabytes for search performance; smaller wastes overhead, larger slows recovery and search. Calculate primary shard count as expected daily volume divided by target shard size; do not copy default settings. Configure Index State Management policies to roll over on size or age and to transition through hot, warm, and cold phases. Force merge on rollover to reduce segment count and free heap. Disable the _source field only if you genuinely never need to retrieve original events, which is rarely true for security data because investigations require raw context. Map fields explicitly; dynamic mapping will create fields like user.name.keyword and user.name in parallel, doubling storage and creating subtle query inconsistencies. Use ECS field names consistently from day one. Plan capacity with the formula: raw daily ingest times replication factor times 1.2 for overhead times retention days, then add 25 percent headroom. Cluster pain almost always traces back to one of three failures: unbounded shard count, unbounded field count from dynamic mapping, and undersized heap relative to data.

Parsing, Normalization, and the ECS Discipline

Detection engineering at scale requires that source.ip means the same thing in every index. The Elastic Common Schema gives you that vocabulary; adopt it without modification. Parse at the collector when possible and at Logstash when not. Fluent Bit handles common formats natively and supports Lua for custom logic; Logstash grok filters remain the most flexible option for unstructured logs but are computationally expensive. For Windows Event Log, use Winlogbeat or the native XML ingestion to preserve event structure; flattening XML into key-value loses context you will need later. For CEF and LEEF, parse to ECS at ingestion rather than at query time; query-time parsing destroys performance and prevents efficient aggregation. Normalize timestamps to UTC at the collector, never at the indexer. Add an event.ingested timestamp separate from the source timestamp; the gap between them is your end-to-end pipeline latency metric and one of the most useful health signals you have. Document every parser in a repository alongside test fixtures; a parsing change without a regression test will eventually break a detection rule and you will not notice until the rule fails to fire on a real attack. Treat parsing as production code, not configuration.

Detection Engineering on OpenSearch

OpenSearch Alerting supports per-document monitors that evaluate each indexed event against a query and bucket-level monitors that aggregate over time windows. For SIEM use, you want both. Per-document monitors are right for atomic detections such as Sigma single-event rules; bucket-level monitors are right for rate, cardinality, and threshold logic. Convert Sigma rules with the pySigma OpenSearch backend; expect to hand-tune perhaps 20 percent of rules where the conversion does not map cleanly, particularly rules that depend on Sysmon-specific fields or correlation across events. Build a detection-as-code repository with rule sources in YAML, a CI pipeline that converts and validates against OpenSearch DSL, and a deployment step that pushes monitors via the API. Tag every rule with ATT&CK technique, data source, severity, and ownership. Implement throttling on every monitor to prevent alert storms during incidents. Schedule monitors with awareness of cluster load; running 500 monitors every minute on a small cluster will eat your search capacity and slow analyst queries. Stagger schedules and use bucket-level monitors with longer intervals where the detection logic permits.

The Operational Tax Nobody Quotes You

Plan for 0.5 to 1.0 FTE of platform engineering time per production cluster, indefinitely. The work includes JVM heap tuning when GC pauses cause cluster instability, certificate rotation across nodes and clients quarterly or more often, version upgrades that are non-trivial across major versions and occasionally require reindexing, shard rebalancing intervention when the cluster gets stuck, snapshot and restore testing on a real schedule because untested backups are not backups, capacity forecasting as ingest grows, and the inevitable midnight pages when a node dies under load. Add another 0.5 FTE of detection engineering time for rule development, tuning, and content curation; that cost exists regardless of platform but is more visible here because you cannot blame the vendor. Budget for hardware refresh on a three-year cycle, license costs for non-free plugins if you choose Elasticsearch over OpenSearch, and observability tooling for the cluster itself, which is non-negotiable. The savings versus a commercial SIEM are real but they are paid in headcount and operational risk rather than software licensing. Going in with that framing produces a successful build; going in expecting free produces a project that quietly degrades until someone proposes migrating back.

The bottom line

A self-hosted OpenSearch SIEM is a legitimate, production-proven choice for teams with the operational maturity to run it. The architecture is well understood, the detection content ecosystem is healthy, and the cost model can be dramatically better than commercial alternatives at scale.

The failure mode is not technical; it is organizational. Build the system with honest staffing, treat parsing and detection content as production code, accept the operational tax explicitly, and the platform will serve you for years. Try to do it on the side with half a person and a vendor mindset, and it will degrade into a liability faster than the commercial renewal you were trying to avoid.

Frequently asked questions

Should I choose OpenSearch or Elasticsearch?

For new builds, OpenSearch is the default unless you have a specific need for an Elastic-only feature such as the ML anomaly detection jobs in their commercial tier. OpenSearch is fully open source under Apache 2.0, has a strong cloud and community ecosystem, and avoids the licensing ambiguity that affected Elasticsearch after the SSPL change. Existing Elasticsearch deployments do not need to migrate urgently; plan it as a deliberate project tied to a major version upgrade.

Do I really need Kafka between collectors and the cluster?

Above a few thousand events per second sustained, yes. Kafka absorbs ingest spikes that would otherwise back-pressure your collectors and drop events, decouples collector failures from indexer failures, and gives you replay capability when you need to reprocess data after a parser change. Below that threshold a smaller buffer or direct ingest can work, but the architecture is much harder to scale later if you do not put the buffer in from the start.

How much retention can I realistically afford?

Hot retention of 30 to 90 days on NVMe is the typical search-performant range. Warm retention of 6 to 12 months on SATA SSD or spinning disk is common. Cold and frozen tiers backed by S3 or compatible object storage extend retention to years at low cost, with the trade that searches against frozen data are slow and should be reserved for forensic use. Budget storage with raw daily ingest times replication factor times retention period in days, plus 25 percent headroom.

How do I handle detection content portability if I migrate later?

Author detections in Sigma YAML as your source of truth and convert to OpenSearch DSL at deploy time via pySigma. If you later move to a different platform, the same Sigma rules convert to Splunk SPL, Microsoft Sentinel KQL, or Chronicle YARA-L with the appropriate backends. Detection logic written directly in OpenSearch Query DSL is portable only with rewrite effort, so keep it minimal and as a fallback for rules Sigma cannot express.

What is the most common failure mode for self-hosted clusters?

Unbounded shard count from poorly designed index lifecycle policies. A cluster that started healthy at a few hundred shards grows to tens of thousands over a year, master node memory pressure increases, cluster state updates slow, and eventually the cluster becomes unresponsive under load. The fix is index lifecycle management with rollover, force merge, and explicit shard count tuning from day one. Audit shard count weekly and treat growth past your target as an incident.

Sources & references

  1. OpenSearch Documentation
  2. Elastic Common Schema
  3. pySigma OpenSearch Backend
  4. Fluent Bit Documentation

Free resources

25
Free download

Critical CVE Reference Card 2025–2026

25 actively exploited vulnerabilities with CVSS scores, exploit status, and patch availability. Print it, pin it, share it with your SOC team.

No spam. Unsubscribe anytime.

Free download

Ransomware Incident Response Playbook

Step-by-step 24-hour IR checklist covering detection, containment, eradication, and recovery. Built for SOC teams, IR leads, and CISOs.

No spam. Unsubscribe anytime.

Free newsletter

Get threat intel before your inbox does.

50,000+ security professionals read Decryption Digest for early warnings on zero-days, ransomware, and nation-state campaigns. Free, daily, no spam.

Unsubscribe anytime. We never sell your data.

Eric Bang
Author

Founder & Cybersecurity Evangelist, Decryption Digest

Cybersecurity professional with expertise in threat intelligence, vulnerability research, and enterprise security. Covers zero-days, ransomware, and nation-state operations for 50,000+ security professionals every morning.

Black Hat Giveaway

Win a $2,495 Black Hat pass.

Full-access to Black Hat USA 2026 in Las Vegas. Subscribe free to enter.

Joins Decryption Digest daily briefing. Unsubscribe anytime.

Giveaway: Black Hat USA 2026 Full-Access Pass ($2,495 value)

Details →
Daily Briefing

Subscribe to enter the giveaway

Every subscriber is automatically entered. You also get daily threat intel every morning: zero-days, ransomware, and nation-state campaigns. Free. No spam.

Already subscribed? You're already entered.

Giveaway

Win a $2,495 Black Hat USA 2026 pass.