The following table describes the key configuration parameters used in the snippets above:
Parameter
Description
collection_interval
The interval between host metric scrapes. Default: 60s.
scrapers
The host-level metric categories to collect (cpu, load, memory, disk, filesystem, network, process). Disable any metric you don't need by setting enabled: false.
Collect Elasticsearch logs
Requirements
Read access to your Elasticsearch log files, for whichever account runs the collector service:
Linux host: read permission on /var/log/elasticsearch/
Docker: read permission on /var/lib/docker/containers/ (root, or Docker group membership)
To collect Elasticsearch logs, add the filelog receiver.
Ensure the account running the collector service (nrdot-collector) has read access to your Elasticsearch log files.
If Elasticsearch runs on a Linux host, use this configuration:
receivers:
filelog:
include:
- /var/log/elasticsearch/elasticsearch.log
- /var/log/elasticsearch/*.log
If Elasticsearch runs in Docker, use this configuration:
receivers:
filelog:
include:
- /var/lib/docker/containers/*/*.log
operators:
-type: move
from: attributes.log
to: body
And add to the service pipelines:
service:
pipelines:
logs:
receivers:[filelog]
processors:[resource/cluster_name_override]
exporters:[otlphttp]
Ensure the account running the collector service (otelcol-contrib) has read access to your Elasticsearch log files.
If Elasticsearch runs on a Linux host, use this configuration:
receivers:
filelog:
include:
- /var/log/elasticsearch/elasticsearch.log
- /var/log/elasticsearch/*.log
If Elasticsearch runs in Docker, use this configuration:
receivers:
filelog:
include:
- /var/lib/docker/containers/*/*.log
operators:
-type: move
from: attributes.log
to: body
And add to the service pipelines:
service:
pipelines:
logs:
receivers:[filelog]
processors:[resource/cluster_name_override]
exporters:[otlphttp]
Configuration parameters
The following table describes the key configuration parameters used in the snippets above:
Parameter
Description
include
Log file paths to tail (Linux host) or container log paths (Docker).
operators (Docker only)
The operator that moves the log line from attributes.log to body so it displays correctly.
Add custom metadata tags
To add custom metadata tags to your metrics, use the resource/static_override processor:
For a Helm install, re-run the same helm upgrade --install ... -f values.yaml command from your install step to roll out the updated config.
Verify your changes
After restarting the collector, confirm your change took effect:
Secured cluster: Rerun your install page's data collection query. If metrics are flowing with no TLS or authentication errors in the collector logs, the secured connection is working.
Host metrics: Run this query:
FROM Metric SELECTcount(*)WHERE metricName LIKE'system.%' SINCE 10 minutes ago
Elasticsearch logs: Run this query:
FROM Log SELECTcount(*) SINCE 10 minutes ago
Adjust the WHERE clause to match your own log attributes.