How to use regex in ECS task definition JSON?
0
I'm trying to add awslogs-multiline-pattern to my ECS task definition. For matching timestamp, I'd like to use
"awslogs-multiline-pattern": "^\[([0-9]{2}:[0-9]{2}:[0-9]{2} [A-Z]{3})\]"
but getting " Unexpected token [ in JSON ..." error during deploy. I couldn't find a direction for a fix/workaround.
TIA, Vitaly
asked 2 months ago2 views
1 Answers
1
Possibly it's treating the escape as a String escape rather than a regex escape? Perhaps try:
"^\\[([0-9]{2}:[0-9]{2}:[0-9]{2} [A-Z]{3})\\]"
I'm not using this anywhere currently, and I didn't construct a test, so this guess might not pay off, but seems worth a shot.
answered 2 months ago
Relevant questions
Charging operate Task for execution time
Accepted Answerasked 5 months agoWhy do deployments with CodeDeploy to ECS (fargate) without tasks succeed?
asked 8 days agoCloudwatch Event ECS payload?
asked 3 years agoUnable to create a new revision of Task Definition
asked a year agoWeb Console UI bug in ECS
asked 2 years agoThe "new" Amazon ECS Console is missing fundamental options like container command overrides
asked 3 months agoHow to convince EventBridge to pass S3 event information to an ecs target?
Accepted AnswerHow to use regex in ECS task definition JSON?
asked 2 months agoHow to I troubleshoot a deploy that is forever in "IN_PROGRESS"?
asked 6 months agodefining the name of task definition json to run ecs task in github actions
asked 2 years ago