Skip to content

[receiver/filelogreceiver] Filelogreceiver doesn't read from file in case there are two or more empty lines at the beginning #10128

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

Closed
perk opened this issue May 18, 2022 · 2 comments · Fixed by #12344
Assignees
Labels
bug Something isn't working priority:p2 Medium receiver/filelog

Comments

@perk
Copy link
Contributor

perk commented May 18, 2022

Describe the bug
Filelogreceiver doesn't read from file in case there are two or more empty lines at the beginning when the start_at: beginning is used.

Steps to reproduce
Create the following logs.txt file to read the data from:



three
four
five

Apply the following configuration:

receivers:
  filelog:
    include:
    - ./logs.txt
    start_at: beginning

exporters:
  logging:

service:
  pipelines:
    logs:
      receivers: [filelog]
      exporters: [logging]

Run the otelcol:

./otelcol-contrib --config config.yaml

See the following lines:

2022-05-18T14:16:59.785+0200	info	service/collector.go:146	Everything is ready. Begin running and processing data.
2022-05-18T14:16:59.988+0200	info	file/file.go:174	Started watching file	{"kind": "receiver", "name": "filelog", "operator_id": "file_input", "operator_type": "file_input", "path": "logs.txt"}

Try to add anything into the file:

echo six >> logs.txt
echo seven >> logs.txt

Nothing happens at this point, file is not being read.

What did you expect to see?
I'd expect to see all the logs - old a new ones - collected.

What did you see instead?
Collector doesn't receive the data from the file at all.

What version did you use?
0.51.0

What config did you use?

receivers:
  filelog:
    include:
    - ./logs.txt
    start_at: beginning

exporters:
  logging:

service:
  pipelines:
    logs:
      receivers: [filelog]
      exporters: [logging]

Environment
OS: Ubuntu 20.04, MacOS 12.3.1

@perk perk added the bug Something isn't working label May 18, 2022
@perk perk changed the title Filelogreceiver doesn't read from file in case there are two or more empty lines at the beginning [receiver/filelogreceiver] Filelogreceiver doesn't read from file in case there are two or more empty lines at the beginning May 18, 2022
@djaglowski
Copy link
Member

Related to #10125 and #10127

@dmitryax
Copy link
Member

@djaglowski please assign accordingly if we have someone to work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p2 Medium receiver/filelog
Projects
None yet
4 participants