-
Notifications
You must be signed in to change notification settings - Fork 333
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
Sanitize log names #1188
Sanitize log names #1188
Conversation
streamalert/shared/config.py
Outdated
if config.get('logs'): | ||
config['logs'] = _sanitize_logs_name(config['logs']) | ||
|
||
if (config.get('global') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eeek conditional blocks like this make me cringe so hard. readability is so bad. can be break this up into multiple statements?
like:
infra_config = config.get('global', {}).get('infrastructure')
if not infra_config:
return config
if 'firehose' not in infra_config:
return config
# ... and so on ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative way is to lump it into a function>
if self._requires_sanitized_log_names(etc):
return config['global']....
return config
6bc27fc
to
a3ea5c5
Compare
Hi @ryandeivert , about your concern
I have checked the code and tested the new changes in the staging environment with a weird log name |
to: @ryandeivert @Ryxias @blakemotl
cc: @airbnb/streamalert-maintainers
related to:
resolves: #1186
Background
See the issue #1186 for more details.
Changes
.
(dot) in the log names inconf/schemas/*.json
orconf/logs.json
with_
(underscore). The change is made toConfig
class where all the conf files are loaded..
with_
when inspectlog
source in the testing events. Eventually there are two carbonblack testing events withlog
set tocarbonblack:ingress.event.procstart
andcarbonblack:ingress_event_procstart
.Testing
python manage.py athena create-table --bucket nobody2020030420-streamalert-data --table-name carbonblack_alert_status_updated
works in staging environment with the fix.