Skip to content
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

Fix timestamp differ rule doc #723

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ the list is now fixed inside the packaged logprep
* allow `TimeParser` to get the current time with a specified timezone instead of always using local time and setting the timezone to UTC
* remove `tldextract` dependency
* remove `urlextract` dependency
* fix wrong documentation for `timestamp_differ`

### Bugfix

Expand Down
10 changes: 4 additions & 6 deletions logprep/processor/timestamp_differ/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
Rule Configuration
^^^^^^^^^^^^^^^^^^

The timestamp format can be specified per timestamp. Following patterns can be used to define the
timestamp format:
`Timestamp tokens <https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes>`_.
The timestamp format can be specified per timestamp.

A speaking example:

Expand All @@ -31,7 +29,7 @@

{"ingest": "2022-12-06 10:00:00", "processed": "2022-12-06 10:00:05", "processing_time": "5.0"}

.. autoclass:: logprep.processor.timestamper.rule.TimestamperRule.Config
.. autoclass:: logprep.processor.timestamp_differ.rule.TimestampDifferRule.Config
:members:
:undoc-members:
:inherited-members:
Expand Down Expand Up @@ -69,8 +67,8 @@ class Config(FieldManagerRule.Config):
and the timestamp format can be specified in the form of:
:code:`${dotted.field.path:timestamp-format}`. If no timestamp format is given, e.g.
:code:`${dotted.field.path}`, the string will be assumed as an iso8601 compliant string and
parsed. For more information on the format syntax see
`datetime strftime/strptime <https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes>`_."""
parsed. For more information on the format syntax see `datetime strftime/strptime
<https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes>`_."""
source_fields: list = field(factory=list)
source_field_formats: list = field(factory=list)
output_format: str = field(
Expand Down
Loading