-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[summerospp]add fluentbit mqtt plugin (#911)
* [summerospp]add fluentbit mqtt plugin Signed-off-by: “sjliu1” <“[email protected]”> * [summerospp]add fluentbit mqtt plugin Signed-off-by: “sjliu1” <“[email protected]”> * [summerospp]add fluentbit mqtt plugin Signed-off-by: “sjliu1” <“[email protected]”> --------- Signed-off-by: “sjliu1” <“[email protected]”> Co-authored-by: “sjliu1” <“[email protected]”>
- Loading branch information
Showing
10 changed files
with
147 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
20 changes: 20 additions & 0 deletions
20
apis/fluentbit/v1alpha2/plugins/input/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters