Skip to content

Commit

Permalink
fix typo in StringSplitterRule
Browse files Browse the repository at this point in the history
- Corrected 'delimiter' typo across test and implementation files.
- Updated changelog to reflect this fix.
  • Loading branch information
dtrai2 committed Nov 13, 2024
1 parent 798a070 commit c077e32
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

* `CriticalInputError` is raised when the input preprocessor values can't be set, this was so far only true
for the hmac preprocessor, but is now also applied for all other preprocessors.
* fix `delimiter` typo in `StringSplitterRule` configuration

### Features
### Improvements
Expand Down
2 changes: 1 addition & 1 deletion logprep/processor/string_splitter/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ def _apply_rules(self, event: dict, rule: StringSplitterRule):
self._handle_missing_fields(event, rule, rule.source_fields, [source_field_content])
if not isinstance(source_field_content, str):
raise ProcessingWarning(f"source_field '{source_field}' is not a string", rule, event)
result = source_field_content.split(rule.delimeter)
result = source_field_content.split(rule.delimiter)
self._write_target_field(event, rule, result)
10 changes: 5 additions & 5 deletions logprep/processor/string_splitter/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ class Config(FieldManagerRule.Config):
validators.max_len(1),
],
)
delimeter: str = field(validator=validators.instance_of(str), default=" ")
"""The delimeter for splitting. Defaults to whitespace"""
delimiter: str = field(validator=validators.instance_of(str), default=" ")
"""The delimiter for splitting. Defaults to whitespace"""
mapping: dict = field(default="", init=False, repr=False, eq=False)
ignore_missing_fields: bool = field(default=False, init=False, repr=False, eq=False)

@property
def delimeter(self):
"""returns the configured delimeter"""
return self._config.delimeter
def delimiter(self):
"""returns the configured delimiter"""
return self._config.delimiter
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"string_splitter": {
"source_fields": ["message"],
"target_field": "result",
"delimeter": ", ",
"delimiter": ", ",
},
},
{"message": "this, is, the, message"},
Expand Down

0 comments on commit c077e32

Please sign in to comment.