INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: Monitoring and recovering event processing

Design CloudWatch Logs for investigation, retention, and sensitive data

Decide what evidence investigators need before you emit logs. Use a fictional image-processing system to choose useful fields while controlling sensitive data and log costs.

What you will learn

Distinguish log groups from streams and choose retention, access, and detail based on investigation requirements.

Prerequisite

The examples use fictional request identifiers. You do not need real logs or personal information.

Choose what to record and who needs to read it

A log group in CloudWatch Logs shares settings such as retention and access. A log stream is a sequence of events from one source. Limiting what the application emits can keep unnecessary sensitive data out of storage.

Design investigation logs for image processing
Design investigation logs for image processing1: Operation — Select the necessary fields — Useful fields. 2: Useful fields — Check retention and access — Storage and access. 3: Storage and access — Read the relevant scope — Investigation123OperationUseful fieldsStorage and accessInvestigationDesign investigation logs for image processing1: Operation — Select the necessary fields — Useful fields. 2: Useful fields — Check retention and access — Storage and access. 3: Storage and access — Read the relevant scope — Investigation123OperationUseful fieldsStorage andaccessInvestigation
  1. Operation → Useful fieldsSelect the necessary fields
  2. Useful fields → Storage and accessCheck retention and access
  3. Storage and access → InvestigationRead the relevant scope
Operation
Intake and saved result
Useful fields
Time, request ID, and stage
Storage and access
Set requirements by group
Investigation
Find the request in the relevant period

Select fields based on the investigation task

Fictional example. No current per-MB prices are used.
InformationTreatmentReason
Intake time, request ID img-17, and processing stageKeepThese fields let an investigator correlate the same request.
Image body and authentication headerOmit from general investigation logsThese are unnecessary for finding the failing stage and increase exposure.
Error category and fictional codeKeepThe error can be classified without the underlying payload.
Query the incident windowNarrow the groups and time rangeRead relevant records and limit the data scanned.

Shorter retention changes how long events are stored. Check ingestion separately when you change emitted log volume, and check scanned data separately when you narrow a query.

Separate masking after ingestion from limiting original output

Handle sensitive content. CloudWatch Logs data protection can mask matches to selected identifiers when ingested events are viewed. It does not apply retroactively to existing events. Authorized viewers may be able to see the original values.

Keep the investigation window available. Consider delayed incident reports and organizational retention requirements. A retention change does not change the volume that was already ingested.

Choose how to record and query the evidence

Choose an option to see the result and explanation.

Which fields should you keep to investigate where a conversion failed?
Read the answer and reason

Answer: Time, request ID, stage, and error category · A request ID and processing stage let you follow the work.

What changes directly when you shorten only the retention setting?
Read the answer and reason

Answer: The storage period · Retention controls how long logs remain stored.

You add masking now. How do you treat earlier log events?
Read the answer and reason

Answer: Review historical data and its access separately · Previously ingested events are outside the policy’s retroactive scope.

Check, then explain in your own words

  1. Choose which fields the investigation needs and which to omit.
  2. Check retention and access by log group.
  3. Measure ingestion, storage, and query scanning separately.
Check your understanding: Does adding masking make it appropriate to log authentication credentials?

Omit credentials that the investigation does not need before emitting the event.

Masking has a defined scope, and the stored value still needs to be protected.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.