-
Notifications
You must be signed in to change notification settings - Fork 301
[summerospp]add fluentbit mqtt plugin #911
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -59,6 +59,8 @@ type InputSpec struct { | |||||
OpenTelemetry *input.OpenTelemetry `json:"openTelemetry,omitempty"` | ||||||
// HTTP defines forward input plugin configuration | ||||||
HTTP *input.HTTP `json:"http,omitempty"` | ||||||
// MQTT defines forward input plugin configuration | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed, thanks! |
||||||
MQTT *input.MQTT `json:"mqtt,omitempty"` | ||||||
} | ||||||
|
||||||
// +kubebuilder:object:root=true | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package input | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins" | ||
"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins/params" | ||
) | ||
|
||
// +kubebuilder:object:generate:=true | ||
|
||
// The MQTT input plugin, allows to retrieve messages/data from MQTT control packets over a TCP connection. <br /> | ||
// The incoming data to receive must be a JSON map. <br /> | ||
// **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/mqtt** | ||
type MQTT struct { | ||
// Listener network interface, default: 0.0.0.0 | ||
Listen string `json:"listen,omitempty"` | ||
// TCP port where listening for connections, default: 1883 | ||
// +kubebuilder:validation:Minimum:=1 | ||
// +kubebuilder:validation:Maximum:=65535 | ||
Port *int32 `json:"port,omitempty"` | ||
} | ||
|
||
func (_ *MQTT) Name() string { | ||
return "mqtt" | ||
} | ||
|
||
// implement Section() method | ||
func (m *MQTT) Params(_ plugins.SecretLoader) (*params.KVs, error) { | ||
kvs := params.NewKVs() | ||
if m.Listen != "" { | ||
kvs.Insert("Listen", m.Listen) | ||
} | ||
if m.Port != nil { | ||
kvs.Insert("Port", fmt.Sprint(*m.Port)) | ||
} | ||
return kvs, nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -420,7 +420,8 @@ InputSpec defines the desired state of ClusterInput | |
| customPlugin | CustomPlugin defines Custom Input configuration. | *custom.CustomPlugin | | ||
| forward | Forward defines forward input plugin configuration | *[input.Forward](plugins/input/forward.md) | | ||
| openTelemetry | OpenTelemetry defines forward input plugin configuration | *[input.OpenTelemetry](plugins/input/opentelemetry.md) | | ||
| http | HTTP defines forward input plugin configuration | *[input.OpenTelemetry](plugins/input/opentelemetry.md) | | ||
| http | HTTP defines forward input plugin configuration | *[input.HTTP](plugins/input/http.md) | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docs not updated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done it, thanks! |
||
| mqtt | MQTT defines forward input plugin configuration | *[input.MQTT](plugins/input/mqtt.md) | | ||
|
||
[Back to TOC](#table-of-contents) | ||
# NamespacedFluentBitCfgSpec | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# MQTT | ||
|
||
The MQTT input plugin, allows to retrieve messages/data from MQTT control packets over a TCP connection. <br /> The incoming data to receive must be a JSON map. <br /> **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/mqtt** | ||
|
||
|
||
| Field | Description | Scheme | | ||
| ----- | ----------- | ------ | | ||
| listen | Listener network interface, default: 0.0.0.0 | string | | ||
| port | TCP port where listening for connections, default: 1883 | *int32 | |
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.
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.
// OpenTelemetry defines the OpenTelemetry input plugin
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.
Fixed, thanks!