A Cloud Engineer is configuring the unified Ops Agent on a fleet of Linux Compute Engine virtual machines (VMs) to ingest custom application logs located at `/var/log/app_telemetry.log` into Cloud Logging. After installing the agent with its default configuration, system metrics and standard syslog entries are correctly appearing in Cloud Observability, but entries from `/var/log/app_telemetry.log` are missing. Which modification to the Ops Agent configuration file (`/etc/google-cloud-ops-agent/config.yaml`) is required to ingest these custom log entries?
- Add a receiver of type `files` specifying `/var/log/app_telemetry.log` under `include_paths` in the `logging` section, and reference that receiver in a logging pipeline under `service`.Cevap
- BInstall and configure the legacy Stackdriver Logging Agent (`google-fluentd`) alongside the Ops Agent to process non-system log files.
- CGrant the Compute Engine default service account the primitive Owner role (`roles/owner`) so the agent gains permission to tail custom local directory paths.
- DEnable the Cloud Logging API in the organization resource node rather than in the project hosting the virtual machines.
Cevap
Add a receiver of type `files` specifying `/var/log/app_telemetry.log` under `include_paths` in the `logging` section, and reference that receiver in a logging pipeline under `service`.
To collect non-standard application log files using the unified Google Cloud Ops Agent, you must edit `/etc/google-cloud-ops-agent/config.yaml`. Inside the `logging` section, define a receiver with `type: files` and include the path `/var/log/app_telemetry.log` under `include_paths`. Finally, add this receiver to a pipeline under `logging.service.pipelines` so that the agent routes those log lines to Cloud Logging.
Adım Adım Çözüm
Anahtar Kavram
Ops Agent Custom Logging Configuration