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

Treatment of single-line logs #3852

Closed
ms42Q opened this issue Mar 30, 2017 · 10 comments
Closed

Treatment of single-line logs #3852

ms42Q opened this issue Mar 30, 2017 · 10 comments
Labels
enhancement Filebeat Filebeat needs_team Indicates that the issue/PR needs a Team:* label Stalled

Comments

@ms42Q
Copy link

ms42Q commented Mar 30, 2017

Lines that are not terminated with a linebreak are not recognized by the filebeat agent (offset stays 0). This causes trouble, especially when an application writes single-line logfiles that only hold 1 entry.

filebeat-version: filebeat-5.1.1-windows-x86_64

Discussion regarding this issue

It would be nice to have a configuration parameter which enables the processing of logfiles with 1 entry.

@ruflin
Copy link
Member

ruflin commented Mar 30, 2017

I'm thinking if this should potentially be a different prospector type. In your case above it seems to be always one line, but it could also be described as: Send full file as one event. This is not really a typical log use case.

I also assume with these kind of files there is much less complexity. Means they don't have to be monitored for rotation or updates etc. They are read once and that's it?

@ms42Q
Copy link
Author

ms42Q commented Mar 30, 2017

In my case the logfile only consists of one json dictionary and each file is read once and deleted after being fully processed (offset==filesize).

I currently explicitly disable monitoring of those files by setting the close_eof option of the prospector, so your assumption is absolutley right.

@ms42Q ms42Q changed the title [Filebeat enhancement] Treatment of single-line logs Treatment of single-line logs Mar 30, 2017
@gmoskovicz
Copy link

@ruflin is there a way to force this with a timeout just as we do for Logstash? So read everything and when the timeout happens ship what we have already? That would resolve this issue correct?

Basically to ship single line logs we might not need a new line, but just a timeout?

@ruflin
Copy link
Member

ruflin commented Mar 12, 2018

@gmoskovicz Our multiline supports a timeout. I'm wondering if we could use this one. But I would prefer to have a clean solution.

@gmoskovicz
Copy link

The multiline works when there is a new line at the end correct? Or, you don't need multiple lines? My understanding is that the multiline process executes when the new line is there.

@ruflin
Copy link
Member

ruflin commented Mar 13, 2018

@gmoskovicz Yes, correct. Ignore my previous comment.

@botelastic
Copy link

botelastic bot commented Jul 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@botelastic botelastic bot added Stalled needs_team Indicates that the issue/PR needs a Team:* label labels Jul 9, 2020
@botelastic
Copy link

botelastic bot commented Jul 9, 2020

This issue doesn't have a Team:<team> label.

@botelastic botelastic bot closed this as completed Aug 8, 2020
@narph
Copy link
Contributor

narph commented Jan 9, 2023

a fix has been added here #33568 and applied to the Filebeat aws-s3 input only, we should expand this to the file input and rest as well.

@narph narph reopened this Jan 9, 2023
@botelastic botelastic bot removed the Stalled label Jan 9, 2023
@botelastic
Copy link

botelastic bot commented Jan 9, 2024

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Jan 9, 2024
@botelastic botelastic bot closed this as completed Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Filebeat Filebeat needs_team Indicates that the issue/PR needs a Team:* label Stalled
Projects
None yet
Development

No branches or pull requests

4 participants