Skip to content

Commit

Permalink
Changes to handle multiple presets #2321
Browse files Browse the repository at this point in the history
  • Loading branch information
Onager authored and joachimmetz committed Jan 31, 2019
1 parent 1c2942d commit 5fd4344
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions plaso/cli/extraction_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,11 @@ def _CreateProcessingConfiguration(self, knowledge_base):
if preset_definitions:
preset_names = [
preset_definition.name for preset_definition in preset_definitions]
if len(preset_names) != 1:
raise errors.BadConfigOption(
'More than 1 parser preset found for: {0:s} namely: {1:s}'.format(
operating_system, preset_names))
filter_expression = ','.join(preset_names)

logger.info('Parser filter expression set to: {0:s}'.format(
preset_names[0]))
configuration.parser_filter_expression = preset_names[0]
filter_expression))
configuration.parser_filter_expression = filter_expression

return configuration

Expand All @@ -148,7 +145,7 @@ def _ParsePerformanceOptions(self, options):
self._buffer_size = int(self._buffer_size, 10)
except ValueError:
raise errors.BadConfigOption(
'Invalid buffer size: {0:s}.'.format(self._buffer_size))
'Invalid buffer size: {0!s}.'.format(self._buffer_size))

self._queue_size = self.ParseNumericOption(options, 'queue_size')

Expand Down
2 changes: 1 addition & 1 deletion plaso/parsers/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ParserPreset(object):
Attributes:
name (str): name of the preset.
operating_system (list[OperatingSystemArtifact]): operating system
operating_systems (list[OperatingSystemArtifact]): operating system
artifact attribute containers, that specify to which operating
systems the preset applies.
parsers (list[str]): names of parser and parser plugins.
Expand Down

0 comments on commit 5fd4344

Please sign in to comment.