Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log streams with square brackets cannot be used #392

Open
justin8 opened this issue Jun 2, 2023 · 0 comments
Open

Log streams with square brackets cannot be used #392

justin8 opened this issue Jun 2, 2023 · 0 comments

Comments

@justin8
Copy link

justin8 commented Jun 2, 2023

When calling awslogs get with a log stream that contains square brackets ([ ]) I get the following error:

Traceback (most recent call last):
  File "/Users/jdray/.pyenv/versions/3.8.12/lib/python3.8/site-packages/awslogs/bin.py", line 179, in main
    getattr(logs, options.func)()
  File "/Users/jdray/.pyenv/versions/3.8.12/lib/python3.8/site-packages/awslogs/core.py", line 109, in list_logs
    streams = list(self._get_streams_from_pattern(self.log_group_name, self.log_stream_name))
  File "/Users/jdray/.pyenv/versions/3.8.12/lib/python3.8/site-packages/awslogs/core.py", line 101, in _get_streams_from_pattern
    reg = re.compile('^{0}'.format(pattern))
  File "/Users/jdray/.pyenv/versions/3.8.12/lib/python3.8/re.py", line 252, in compile
    return _compile(pattern, flags)
  File "/Users/jdray/.pyenv/versions/3.8.12/lib/python3.8/re.py", line 304, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/Users/jdray/.pyenv/versions/3.8.12/lib/python3.8/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/Users/jdray/.pyenv/versions/3.8.12/lib/python3.8/sre_parse.py", line 948, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/Users/jdray/.pyenv/versions/3.8.12/lib/python3.8/sre_parse.py", line 443, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/Users/jdray/.pyenv/versions/3.8.12/lib/python3.8/sre_parse.py", line 549, in _parse
    raise source.error("unterminated character set",
re.error: unterminated character set at position 12

Repro steps:
awslogs get my/log/stream "2023/06/01/[$LATEST]37fc8397fa59492cab1e6de1ad5d3e1f"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant