From 1fa450715b4aabf83374953b698966b841d0e10b Mon Sep 17 00:00:00 2001 From: Abraham Chavez Date: Tue, 23 May 2023 16:46:38 -0700 Subject: [PATCH] fixup! [u] Send GitLab host logs to CloudWatch (#3894) --- terraform/gitlab/gitlab.tf.json.template.py | 31 ++++++++++----------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/terraform/gitlab/gitlab.tf.json.template.py b/terraform/gitlab/gitlab.tf.json.template.py index 428828db3c..cec6dad073 100644 --- a/terraform/gitlab/gitlab.tf.json.template.py +++ b/terraform/gitlab/gitlab.tf.json.template.py @@ -1560,14 +1560,23 @@ def qq(*words): { 'file_path': path, 'log_group_name': '/aws/cwagent/azul-gitlab', - 'log_stream_name': - path - if not path.endswith('*.log') - else - path.replace('*', 'reconfigure') + 'log_stream_name': path.replace('*', '?') } for path in [ + f'/var/log/{file}' + for file in + [ + 'amazon/ssm/amazon-ssm-agent.log', + 'audit/audit.log', + 'cloud-init.log', + 'cron', + 'maillog', + 'messages', + 'secure' + ] + + ] + [ f'/mnt/gitlab/logs/{file}.log' for file in [ @@ -1601,18 +1610,6 @@ def qq(*words): 'production', 'sidekiq_client' ] - ] + [ - f'/var/log/{file}' - for file in - [ - 'amazon/ssm/amazon-ssm-agent.log', - 'audit/audit.log', - 'cloud-init.log', - 'cron', - 'maillog', - 'messages', - 'secure' - ] ] ] }