jorgebastida / jorgebastida/awslogs

The magic terminal voice says to file an issue, I file an issue

Open
#314 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5k
Forks
342
PR merge metrics
No merged PRs in 30d

Description

Command was `awslogs get /service/subcategory '*ERROR*'`

```Version: 0.14.0
Python: 3.8.2 (default, Jul 16 2020, 14:00:26)
[GCC 9.3.0]
boto3 version: 1.14.51
Platform: Linux-5.4.0-45-generic-x86_64-with-glibc2.29
Args: ['/home/spitts/.local/bin/awslogs', 'get', '/newswire/stage', '*ERROR*']
Config: {'aws_access_key_id': 'SENSITIVE', 'aws_secret_access_key': 'SENSITIVE', 'aws_session_token': 'SENSITIVE', 'aws_profile': 'SENSITIVE', 'aws_region': None, 'aws_endpoint_url': None, 'log_group_name': '/newswire/stage', 'log_stream_name': '*ERROR*', 'filter_pattern': None, 'watch': False, 'watch_interval': 1, 'output_group_enabled': True, 'output_stream_enabled': True, 'output_timestamp_enabled': False, 'output_ingestion_time_enabled': False, 'start': '5m', 'end': None, 'color': 'auto', 'query': None, 'func': 'list_logs'}

Traceback (most recent call last):
File "/home/spitts/.local/lib/python3.8/site-packages/awslogs/bin.py", line 179, in main
getattr(logs, options.func)()
File "/home/spitts/.local/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 "/home/spitts/.local/lib/python3.8/site-packages/awslogs/core.py", line 101, in _get_streams_from_pattern
reg = re.compile('^{0}'.format(pattern))
File "/usr/lib/python3.8/re.py", line 250, in compile
return _compile(pattern, flags)
File "/usr/lib/python3.8/re.py", line 302, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib/python3.8/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib/python3.8/sre_parse.py", line 948, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/lib/python3.8/sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "/usr/lib/python3.8/sre_parse.py", line 668, in _parse
raise source.error("nothing to repeat",
re.error: nothing to repeat at position 1

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with awslogs/core.py in list_logs and _get_streams_from_pattern, then reproduce the reported command and traceback. Clarify the intended handling of the '*ERROR*' log-stream pattern and add coverage showing the corrected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.