Type to search.

Elasticsearch security_stats metricset

Serverless

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Serverless interfaces and procedures might differ from classic Elastic Stack deployments.

Stack 9.2+

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available since 9.2

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

This is the security_stats metricset of the Elasticsearch module. It queries the Security Stats API endpoint (GET /_security/stats, available since Elasticsearch 9.2) to collect per-node security counters. The endpoint exposes Document Level Security (DLS) cache statistics, which are useful for spotting cache thrash, oversized working sets, and unhealthy hit/miss ratios across a fleet.

Each emitted event is enriched with node.{name,roles,version} (alongside node.id) via a single side-channel /_nodes call per scrape, so consumers can slice by node, role, or stack version without joining across data streams.

The /_security/stats endpoint is only served when the Elasticsearch security feature is enabled (xpack.security.enabled: true). The metricset checks GET /_xpack on each scrape. When security is disabled, it emits a throttled debug log, but no events.

Authorization follows the same model as /_cluster/stats and /_nodes/stats: the caller needs the monitor cluster privilege.

For a description of each field in the metricset, see the exported fields section.

Here is an example document generated by this metricset:

JSON
{
    "@timestamp": "2026-04-27T20:00:00.000Z",
    "elasticsearch": {
        "cluster": {
            "id": "WocBBA0QRma0sGpdQ7vLfQ",
            "name": "docker-cluster"
        },
        "node": {
            "id": "f5i3v9hMT_q__q6B9WOo5A",
            "name": "instance-0000000019",
            "roles": ["data_hot", "ingest"],
            "version": "9.2.0"
        },
        "security": {
            "stats": {
                "dls": {
                    "cache": {
                        "entries": {
                            "count": 12
                        },
                        "memory": {
                            "bytes": 4096
                        },
                        "hits": {
                            "count": 8421,
                            "time": {
                                "ms": 51
                            }
                        },
                        "misses": {
                            "count": 137,
                            "time": {
                                "ms": 219
                            }
                        },
                        "evictions": {
                            "count": 4
                        }
                    }
                }
            }
        }
    },
    "event": {
        "dataset": "elasticsearch.security.stats",
        "duration": 115000,
        "module": "elasticsearch"
    },
    "metricset": {
        "name": "security_stats",
        "period": 10000
    },
    "service": {
        "address": "172.19.0.2:9200",
        "type": "elasticsearch"
    }
}