-
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 mqtt add cleansession #35806
Filebeat mqtt add cleansession #35806
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 (Team:Elastic-Agent) |
filebeat/input/mqtt/config.go
Outdated
@@ -31,6 +31,7 @@ type mqttInputConfig struct { | |||
ClientID string `config:"client_id" validate:"nonzero"` | |||
Username string `config:"username"` | |||
Password string `config:"password"` | |||
CleanSession bool `config:"clean_session"` |
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.
Could you please run go fmt ./filebeat/input/mqtt/...
?
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.
Done.
Hmm, the linter still does not appear to be happy with the formatting. What version of |
Also, please remember to document the new setting in https://github.com/elastic/beats/blob/main/filebeat/docs/inputs/input-mqtt.asciidoc and add an entry in https://github.com/elastic/beats/blob/main/CHANGELOG.next.asciidoc. |
Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
/test |
@dramis CI is failing due to formatting errors. Could you run |
/test |
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. Thanks for the contribution, @dramis!
* add CleanSession parameter * Cleansession parameter add * correct cleansession parameter name * Defaut clean session to True * formating file * Add missing documentation * Update filebeat/docs/inputs/input-mqtt.asciidoc Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com> * Update filebeat/docs/inputs/input-mqtt.asciidoc Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com> * doc correction * Update CHANGELOG.next.asciidoc Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com> * Update filebeat/docs/inputs/input-mqtt.asciidoc Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com> * correct formatting --------- Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
What does this PR do?
Add clean_session parameter in config file of filebeat mqtt input plugin.
When clean_session is true, the state information is discarded at connect and disconnect. Setting cleansession to false keeps the state information. Default value true
Why is it important?
With clean_session to false, it's possible to keep unread message to Mqtt server.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs