Skip to content

bug: tail_from_end can produces invalid first line #5423

@kalleep

Description

@kalleep

Component(s)

loki.source.file

What's wrong?

When using tail_from_end we run getLastLinePosition. This one does not take encoding into account. This would be a problem for e.g. UTF-16LE because it encodes newlines as 0A 00 so we would point offset at 00 messing up the first line.

Steps to reproduce

Use loki.source.file on a UTF-16LE encoded file and set tail_from_end = true.

System information

No response

Software version

No response

Configuration


Logs


Tip

React with 👍 if this issue is important to you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions