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 years ago528 views
1 Answer
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 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions