From ee6822c6893bb6d855f4e7acf81f2c6298099920 Mon Sep 17 00:00:00 2001 From: Mitch Date: Fri, 18 Sep 2020 15:52:45 +1000 Subject: [PATCH] Add multiline pattern option for task def logs --- ecs-service.cfndsl.rb | 4 ++++ ecs-service.config.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ecs-service.cfndsl.rb b/ecs-service.cfndsl.rb index b855d82..902d47f 100644 --- a/ecs-service.cfndsl.rb +++ b/ecs-service.cfndsl.rb @@ -53,6 +53,10 @@ } } + if task.has_key?('log_pattern') + task_def[:LogConfiguration][:Options]["awslogs-multiline-pattern"] = task['log_pattern'] + end + task_def.merge!({ MemoryReservation: task['memory'] }) if task.has_key?('memory') task_def.merge!({ Memory: task['memory_hard'] }) if task.has_key?('memory_hard') task_def.merge!({ Cpu: task['cpu'] }) if task.has_key?('cpu') diff --git a/ecs-service.config.yaml b/ecs-service.config.yaml index 123d4cf..72f3a7d 100644 --- a/ecs-service.config.yaml +++ b/ecs-service.config.yaml @@ -30,6 +30,8 @@ log_retention: 7 # image: data # memory: 128 # tag_param: DataTag +# NOTE: specify log_pattern (below) if you want to add an awslogs-multiline-pattern to the log driver, otherwise leave it out +# log_pattern: "^INFO" # not_essential: true # env_vars: # KEY: value