nerdexam
Google

PROFESSIONAL-CLOUD-DEVOPS-ENGINEER · Question #179

You are running an application on Compute Engine and collecting logs through Stackdriver. You discover that some personally identifiable information (PII) is leaking into certain log entry fields…

The correct answer is B. Use a Fluentd filter plugin with the Stackdriver Agent to remove log entries containing userinfo. To prevent PII from leaking into Stackdriver Logging, log entries containing sensitive information must be processed and filtered at the source before ingestion into the logging service.

Submitted by brentm· Apr 18, 2026Implementing service monitoring strategies

Question

You are running an application on Compute Engine and collecting logs through Stackdriver. You discover that some personally identifiable information (PII) is leaking into certain log entry fields. All PII entries begin with the text userinfo. You want to capture these log entries in a secure location for later review and prevent them from leaking to Stackdriver Logging. What should you do?

Options

  • ACreate a basic log filter matching userinfo, and then configure a log export in the Stackdriver
  • BUse a Fluentd filter plugin with the Stackdriver Agent to remove log entries containing userinfo,
  • CCreate an advanced log filter matching userinfo, configure a log export in the Stackdriver console
  • DUse a Fluentd filter plugin with the Stackdriver Agent to remove log entries containing userinfo,

How the community answered

(44 responses)
  • A
    16% (7)
  • B
    73% (32)
  • C
    5% (2)
  • D
    7% (3)

Why each option

To prevent PII from leaking into Stackdriver Logging, log entries containing sensitive information must be processed and filtered at the source before ingestion into the logging service.

ACreate a basic log filter matching userinfo, and then configure a log export in the Stackdriver

Creating a basic log filter in Stackdriver (Cloud Logging) operates on logs after they have already been ingested into the service, failing to prevent the PII from initially leaking.

BUse a Fluentd filter plugin with the Stackdriver Agent to remove log entries containing userinfo,Correct

The Cloud Logging agent on Compute Engine utilizes Fluentd for log collection. By configuring a Fluentd filter plugin on the VM, log entries containing 'userinfo' can be intercepted and removed or redirected directly on the instance, preventing them from ever being sent to Stackdriver Logging.

CCreate an advanced log filter matching userinfo, configure a log export in the Stackdriver console

An advanced log filter in Stackdriver (Cloud Logging) also processes logs only after their ingestion, meaning the PII has already been recorded in the logging service before the filter can act.

DUse a Fluentd filter plugin with the Stackdriver Agent to remove log entries containing userinfo,

Assuming the truncated option D is identical to B, it would technically achieve the same outcome, but since B is specified as the correct answer, B is the intended solution.

Concept tested: Log preprocessing and filtering at source agent

Source: https://cloud.google.com/logging/docs/agent/logging/configuration

Topics

#Cloud Logging#Fluentd#PII Protection#Log Filtering

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVOPS-ENGINEER Practice