-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
filebeat/inputs/filestream: add metric for messages truncated #41667
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
126fd1e
to
ed485a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I didn't have time to test it today, but the code is pretty simple. If it has not been merged by tomorrow morning, I'll test it.
e4a16c7
to
d125a58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, but I'm not managing to test it... Filebeat won't start.
Here is the full filebeat.yml
I'm using:
filebeat.inputs:
- type: filestream
id: foo-bar
enabled: true
paths:
- "/tmp/flog.log"
parsers:
- multiline:
type: pattern
pattern: '^LINESTART$"),'
negate: true
match: after
max_bytes: 20
output.discard:
enabled: true
http.enabled: true
Whenever I run, I get the following error:
Exiting: Failed to start crawler: starting input failed: error while initializing input: error while parsing multiline parser config: error parsing regexp: unexpected ): `^LINESTART$"),` accessing 'filebeat.inputs.0.parsers.0.multiline.pattern' (source:'filebeat.yml') accessing 'filebeat.inputs.0' (source:'filebeat.yml')
exit status 1
d192597
to
37720bf
Compare
Probably not an intentional omission Edit: if /inputs/ is the listing of inputs it might be intentional in that it behaves more like a directory listing. |
It is a bit counter intuitive when thinking about REST but it makes sense if it is supposed to be a directory listing. The docs also use |
This pull request is now in conflicts. Could you fix it? 🙏
|
/test |
For some reason, the linter is failing and pointing out issues in the metricbeat mongo module. I don't plan to modify these files to avoid introducing additional linting problems. |
@elastic/obs-infraobs-integrations Kindly requesting a review. Thank you! |
@lalit-satapathy @devamanv can we get someone's eyes on this please? |
@ishleenk17 will be taking a look. |
Why has the mongdb module been touched for this change? @mauri870 |
Thanks, I forgot I had this small change for the struct annotations, I just reverted it. |
* filebeat: log when multiline reader truncates messages While investigating an SDH, I noticed that although we add the truncated label to log fields, there is no feedback explaining why the messages were truncated. This PR adds a log statement to provide insight whenever multiline messages are truncated. (cherry picked from commit 7806f1a) # Conflicts: # filebeat/input/filestream/metrics_integration_test.go
…sages truncated (#42185) * filebeat/inputs/filestream: add metric for messages truncated (#41667) * filebeat: log when multiline reader truncates messages While investigating an SDH, I noticed that although we add the truncated label to log fields, there is no feedback explaining why the messages were truncated. This PR adds a log statement to provide insight whenever multiline messages are truncated. (cherry picked from commit 7806f1a) # Conflicts: # filebeat/input/filestream/metrics_integration_test.go * fix conflicts --------- Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Proposed commit message
While investigating an SDH, I noticed that although we add the truncated label to log fields, there is no feedback on the amount of messages that are truncated. It often happens that almost all messages are truncated because of a misconfigured input.
This PR adds a input metric that counts the total number of truncated messages.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Create a log file with multiline logs:
Configure filebeat to parse the multiline logs with
max_lines
:Check the metrics:
Related issues