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

已提问 2 年前542 查看次数
1 回答
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.

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则