Full collector configuration (multiple log sources)
Simple collector configurations provides a configuration file to set up log collection from a Windows machine. The procedure below is better suited to cases where multiple log types are collected on the same host (Windows or Linux).
Centreon provides ready-to-use configuration templates for the most common log sources. Use them as a starting point to quickly configure your collector.
If you run into any problems, refer to the Troubleshooting page.
Prerequisites​
- Generate a token to authenticate the host to your Centreon Log Management platform.
- The endpoint required to connect an OpenTelemetry Collector to your Centreon Log Management platform is
https://api.euwest1.obs.mycentreon.com/v1/ingress/otlp/v1/logs.
CLM can process log batches up to 5 MiB in size. Beyond that, you will receive a 413 error. (If necessary, use the sending_queue.sizer.bytes parameter in your exporter to adjust the size of your batches.)
Step 1: Install OpenTelemetry Collector on your host​
Use the otelcol-contrib packages to install OpenTelemetry Collector on each device from which you want to collect logs.
- Linux
- Windows
- EL
- Debian
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.145.0/otelcol-contrib_0.145.0_linux_amd64.rpm
dnf install ./otelcol-contrib_0.145.0_linux_amd64.rpm
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.145.0/otelcol-contrib_0.145.0_linux_amd64.deb
apt install ./otelcol-contrib_0.145.0_linux_amd64.deb
https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.147.0/otelcol-contrib_0.147.0_windows_x64.msi
Step 2: Define the global parameters of the collector​
-
Edit the config.yaml file that was created when you installed the collector:
- Linux
- Windows
You must be logged in as root.
/etc/otelcol-contrib/config.yamlC:\Program Files\OpenTelemetry Collector\config.yamlMake sure you save the file as an administrator.
-
In this file, enter the global log collection settings specific to this device. These will apply to all log sources for this device.
- In endpoint, enter
https://api.euwest1.obs.mycentreon.com/v1/ingress/otlp. - In X-Api-Key, enter the token required to authenticate to your CLM platform.
Example:
# Copyright 2025 Centreon.
# SPDX-License-Identifier: Apache-2.0
exporters:
otlphttp/centreon:
endpoint: "https://api.euwest1.obs.mycentreon.com/v1/ingress/otlp"
headers:
"X-Api-Key": "mytoken"
debug:
verbosity: detailed
processors:
batch:
resourcedetection:
detectors: ["system"]
system:
resource_attributes:
host.name:
enabled: true
os.name:
enabled: true
os.type:
enabled: true
os.version:
enabled: trueThe indentation of the parameters in your YAML file must be identical to that in the example. The indentations are two spaces for each level.
- In endpoint, enter
Step 3: Configure each log source for your host​
Configure a log source for each desired service (syslog, apache, etc.) in the form of a YAML file.
-
Create the following directory:
- Linux
- Windows
mkdir /etc/otelcol-contrib/conf.d/C:\Program Files\OpenTelemetry Collector\conf.d -
In this directory, create one file per log source. For example: the httpd-combined.yaml and httpd-error.yaml files will contain the configuration for the Apache access log and Apache error log, respectively.
-
Retrieve from GitHub the sample file for the log source you want.
-
On the source device, copy and paste the code snippet into the corresponding file, and adapt it to your environment and your OS. Save the file. If you are using several log sources for a collector, make sure you define the pipeline only once (in one of the files). The pipeline must mention all your receivers. In our example:
service:
pipelines:
logs:
receivers: [filelog/httpd-combined,filelog/apache-error]The indentation of the parameters in your YAML file must be identical to that in the example. The indentations are two spaces for each level.
-
Declare each of the files you created: declare a --config option for each file, as in the following example (be sure to keep the declaration of the global configuration file config.yaml):
- Linux
- Windows
In /etc/otelcol-contrib/otelcol-contrib.conf, add the following line (adapt it to your actual file names):
OTELCOL_OPTIONS="--config=/etc/otelcol-contrib/config.yaml --config=/etc/otelcol-contrib/conf.d/httpd-combined.yaml --config=/etc/otelcol-contrib/conf.d/httpd-error.yaml"In a PowerShell terminal, run the following command (adapt it to your actual file names):
Get-WmiObject win32_service -filter "Name='otelcol-contrib'" | Invoke-WmiMethod -Name Change -ArgumentList @($null,$null,$null,$null,$null, '"C:\Program Files\OpenTelemetry Collector\otelcol-contrib.exe" --config "C:\Program Files\OpenTelemetry Collector\config.yaml" --config "C:\Program Files\OpenTelemetry Collector\conf.d\windows-event-log.yaml"') -
Restart the OpenTelemetry Collector service.
- Linux
- Windows
systemctl restart otelcol-contrib.servicenet stop otelcol-contrib
net start otelcol-contrib