-
Notifications
You must be signed in to change notification settings - Fork 334
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
[lambda][rule] fixing a bug related to log_pattern enforcement #131
Conversation
da68f9b
to
cc3a6ce
Compare
# configuration settings such as envelope and optional_keys | ||
converted_data = self._convert_type(data, parser.type(), parser.schema, parser.options) | ||
converted_data = self._convert_type(data, valid_parse.parser.type(), valid_parse.root_schema, valid_parse.parser.options) |
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.
rename this to conversion_result
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.
simplified this - ptal
schema_match = False | ||
|
||
for json_record in json_records: | ||
json_keys = set(json_record.keys()) | ||
for i in reversed(range(len(json_records))): |
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.
can we use a different variable name an i
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.
sure thing
42d1d8e
to
4a1dcf4
Compare
|
||
from stream_alert.rule_processor.parsers import get_parser | ||
|
||
logging.basicConfig() | ||
LOGGER = logging.getLogger('StreamAlert') | ||
|
||
# Set the below to True when we want to support multiple matching on multiple schema |
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.
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.
def _parse(self, payload, data): | ||
"""Parse a record into a declared type. | ||
def _process_log_schemas(self, payload, data): | ||
"""Get any log schemas that properly classified this log |
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.
The wording is weird. A schema doesn't classify a log, nor does a schema parse a log (said a bit below). We identify what schemas a log matches to.
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.
good eye. changed this
17ebd04
to
a9a1c6b
Compare
* Fixing a bug where typed data was not being returned in records * Recursively nested parsing of csv and json are now supported * Updating tests for multiple schema matching with log_patterns * Updating tests for single schema matching with log_patterns
…keys' and updating docs to reflect the change
a9a1c6b
to
300a722
Compare
to: @airbnb/streamalert-maintainers
size: medium
changes
log_patterns
to logs that matched only one schema and fixed this so log_patterns will always be applied if they exist for a defined schema.