Difference between revisions of "EKS log collector script"

From wikieduonline
Jump to navigation Jump to search
Line 11: Line 11:
 
   --content file://eks-ssm-content.json
 
   --content file://eks-ssm-content.json
  
  aws ssm send-command \
+
  [[aws ssm send-command]] \
 
   --instance-ids <EC2 Instance ID> \
 
   --instance-ids <EC2 Instance ID> \
 
   --document-name "EKSLogCollectorLinux" \
 
   --document-name "EKSLogCollectorLinux" \
 
   --parameters "bucketName=<S3 bucket name to push the logs>" \
 
   --parameters "bucketName=<S3 bucket name to push the logs>" \
 
   --output json
 
   --output json
 +
 +
[[aws ssm get-command-invocation]] \
 +
  --command-id "<SSM command ID>" \
 +
  --instance-id "<EC2 Instance ID>" \
 +
  --output text
  
 
== Related ==
 
== Related ==

Revision as of 10:57, 26 February 2024

curl -O https://raw.githubusercontent.com/awslabs/amazon-eks-ami/master/log-collector-script/linux/eks-log-collector.sh
sudo bash eks-log-collector.sh


curl -O https://raw.githubusercontent.com/awslabs/amazon-eks-ami/master/log-collector-script/linux/eks-ssm-content.json
aws ssm create-document \
 --name "EKSLogCollectorLinux" \
 --document-type "Command" \
 --content file://eks-ssm-content.json
aws ssm send-command \
  --instance-ids <EC2 Instance ID> \
  --document-name "EKSLogCollectorLinux" \
  --parameters "bucketName=<S3 bucket name to push the logs>" \
  --output json
aws ssm get-command-invocation \
  --command-id "<SSM command ID>" \
  --instance-id "<EC2 Instance ID>" \
  --output text

Related

See also

Advertising: