Send logs from stdin to AWS CloudWatch Logs
echo "Hello, World!" | stdin-to-cloudwatch MyLogGroup MyLogStream
MyLogGroup
is the name of the log group to send the logs to- If the log group does not exist, it will be created
MyLogStream
is the name of the log stream to send the logs to- If the log stream does not exist, it will be created
- The logs are read from stdin, and sent to CloudWatch Logs each line at a time
cargo install stdin-to-cloudwatch
The AWS region to send the logs to.
echo "Hello, World!" | stdin-to-cloudwatch MyLogGroup MyLogStream --region us-west-2
The endpoint URL to send the logs to.
LocalStack users can use this to send logs to LocalStack.
echo "Hello, World!" | stdin-to-cloudwatch MyLogGroup MyLogStream --endpoint-url http://localhost:4566
If the log stream already exists, delete it and create a new one.
echo "Hello, World!" | stdin-to-cloudwatch MyLogGroup MyLogStream --remake-log-stream
Append the current timestamp to the log stream name.
echo "Hello, World!" | stdin-to-cloudwatch MyLogGroup MyLogStream --suffix-stream-name-with-timestamp
stream name will be like MyLogStream-1708169869
Pass the logs through to stdout after sending them to CloudWatch Logs.
echo "Hello, World!" | stdin-to-cloudwatch MyLogGroup MyLogStream --pass-through