Bird
0
0

You run this AWS CLI command:

medium📝 Debug Q14 of 15
AWS - CloudWatch
You run this AWS CLI command:
aws logs put-log-events --log-group-name myGroup --log-stream-name myStream --log-events '[{"timestamp":1609459200000,"message":"Hello"}]'

But you get an error saying the log stream does not exist. What is the most likely fix?
ARemove the timestamp from the log event
BChange the log group name to an existing group
CCreate the log stream 'myStream' inside 'myGroup' before putting events
DUse the create-log-group command instead
Step-by-Step Solution
Solution:
  1. Step 1: Understand error cause

    The error indicates the log stream 'myStream' does not exist in 'myGroup'. You must create the stream before sending logs.
  2. Step 2: Identify correct fix

    Creating the log stream with aws logs create-log-stream resolves the error. Changing group or removing timestamp won't help.
  3. Final Answer:

    Create the log stream 'myStream' inside 'myGroup' before putting events -> Option C
  4. Quick Check:

    Log stream must exist before putting logs [OK]
Quick Trick: Create log stream first to avoid put-log-events error [OK]
Common Mistakes:
  • Trying to put logs before stream creation
  • Ignoring error details about missing stream
  • Confusing log group creation with stream creation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes