3. Filelog Setup
10 minutesThe FileLog Receiver in the OpenTelemetry Collector is used to ingest logs from files.
It monitors specified files for new log entries and streams those logs into the Collector for further processing or exporting. It is useful for testing and development purposes.
For this part of the workshop, there is script that will generate log lines in a file. The Filelog receiver will read these log lines and send them to the OpenTelemetry Collector.
Exercise
- Move to the log-gen terminal window.
- Navigate to the
[WORKSHOP]
directory and create a new subdirectory named3-filelog
. - Next, copy all contents from the
2-gateway
directory into3-filelog
. - After copying, remove any
*.out
and*.log
files. - Change all terminal windows to the
[WORKSHOP]/3-filelog
directory.
Your updated directory structure will now look like this:
WORKSHOP
├── 1-agent
├── 2-gateway
├── 3-filelog
│ ├── agent.yaml # Agent Collector configuration file
│ ├── gateway.yaml # Gateway Collector configuration file
│ └── trace.json # Example trace file
└── otelcol # OpenTelemetry binary