Skip to content

detector.py _extract_timestamp function errors on human readable time format #70

@thorinaboenke

Description

@thorinaboenke

Subject of the issue

detector.py _extract_timestamp function errors on human readable time format

[2026-03-06 15:51:34,279] ERROR detectmatelibrary.detectors.NewValueDetector.ed05a28d662a5747bb4b3ce8fe572888: Engine error during process: could not convert string to float: '04/Mar/2026'

Traceback (most recent call last):
  File "/app/src/service/features/engine.py", line 187, in _run_loop
    out = self.processor.process(raw)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/src/service/core.py", line 193, in process
    return self.library_component.process(raw_message)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/detectmatelibrary/common/core.py", line 117, in process
    return_schema = self.run(input_=data_buffered, output_=output_)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/detectmatelibrary/common/detector.py", line 107, in run
    output_["extractedTimestamps"] = _extract_timestamp(input_)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/detectmatelibrary/common/detector.py", line 23, in _extract_timestamp
    return [format_time(i["logFormatVariables"]["Time"]) for i in input_]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/detectmatelibrary/common/detector.py", line 18, in format_time
    return int(float(time_))
               ^^^^^^^^^^^^

ValueError: could not convert string to float: '04/Mar/2026'

Your environment

  • Version of ruby
  • Docker or manual installation?
  • Which browser and its version

Steps to reproduce

Tell us how to reproduce this issue.

Expected behavior

_extract_timestamp should extract a timestamp

Actual behavior

_extract_timestamp errors on the date "04/Mar/2026:14:18:00 +0000"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions