-
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.
Merge pull request #914 from sjliu1/collectd
[summerospp]add fluentbit collectd plugin
- Loading branch information
Showing
10 changed files
with
144 additions
and
0 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,42 @@ | ||
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 Collectd input plugin allows you to receive datagrams from collectd service. <br /> | ||
// **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/collectd** | ||
type Collectd struct { | ||
// Set the address to listen to, default: 0.0.0.0 | ||
Listen string `json:"listen,omitempty"` | ||
// Set the port to listen to, default: 25826 | ||
// +kubebuilder:validation:Minimum:=1 | ||
// +kubebuilder:validation:Maximum:=65535 | ||
Port *int32 `json:"port,omitempty"` | ||
// Set the data specification file,default: /usr/share/collectd/types.db | ||
TypesDB string `json:"typesDB,omitempty"` | ||
} | ||
|
||
func (_ *Collectd) Name() string { | ||
return "collectd" | ||
} | ||
|
||
// implement Section() method | ||
func (c *Collectd) Params(_ plugins.SecretLoader) (*params.KVs, error) { | ||
kvs := params.NewKVs() | ||
if c.Listen != "" { | ||
kvs.Insert("Listen", c.Listen) | ||
} | ||
if c.Port != nil { | ||
kvs.Insert("Port", fmt.Sprint(*c.Port)) | ||
} | ||
if c.TypesDB != "" { | ||
kvs.Insert("TypesDB", c.TypesDB) | ||
} | ||
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,10 @@ | ||
# Collectd | ||
|
||
The Collectd input plugin allows you to receive datagrams from collectd service. <br /> **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/collectd** | ||
|
||
|
||
| Field | Description | Scheme | | ||
| ----- | ----------- | ------ | | ||
| listen | Set the address to listen to, default: 0.0.0.0 | string | | ||
| port | Set the port to listen to, default: 25826 | *int32 | | ||
| typesDB | Set the data specification file,default: /usr/share/collectd/types.db | string | |
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