Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
telegraf-nftables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2035-04-24.
Why is this scheduled?
Show more breadcrumbs
vqgroup
telegraf-nftables
Commits
cd103c85
Commit
cd103c85
authored
7 years ago
by
Seuf
Committed by
Daniel Nelson
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added SASL options for ouput kafka plugin (#2721)
parent
a3feacbd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
plugins/outputs/kafka/README.md
+4
-0
4 additions, 0 deletions
plugins/outputs/kafka/README.md
plugins/outputs/kafka/kafka.go
+15
-0
15 additions, 0 deletions
plugins/outputs/kafka/kafka.go
with
20 additions
and
0 deletions
CHANGELOG.md
+
1
−
0
View file @
cd103c85
...
...
@@ -41,6 +41,7 @@ be deprecated eventually.
### Features
-
[
#2721
](
https://github.com/influxdata/telegraf/pull/2721
)
: Added SASL options for kafka output plugin.
-
[
#2723
](
https://github.com/influxdata/telegraf/pull/2723
)
: Added SSL configuration for input haproxy.
-
[
#2494
](
https://github.com/influxdata/telegraf/pull/2494
)
: Add interrupts input plugin.
-
[
#2094
](
https://github.com/influxdata/telegraf/pull/2094
)
: Add generic socket listener & writer.
...
...
This diff is collapsed.
Click to expand it.
plugins/outputs/kafka/README.md
+
4
−
0
View file @
cd103c85
...
...
@@ -45,6 +45,10 @@ This plugin writes to a [Kafka Broker](http://kafka.apache.org/07/quickstart.htm
## Use SSL but skip chain & host verification
# insecure_skip_verify = false
## Optional SASL Config
# sasl_username = "kafka"
# sasl_password = "secret"
data_format = "influx"
```
...
...
This diff is collapsed.
Click to expand it.
plugins/outputs/kafka/kafka.go
+
15
−
0
View file @
cd103c85
...
...
@@ -44,6 +44,11 @@ type Kafka struct {
// Skip SSL verification
InsecureSkipVerify
bool
// SASL Username
SASLUsername
string
`toml:"sasl_username"`
// SASL Password
SASLPassword
string
`toml:"sasl_password"`
tlsConfig
tls
.
Config
producer
sarama
.
SyncProducer
...
...
@@ -92,6 +97,10 @@ var sampleConfig = `
## Use SSL but skip chain & host verification
# insecure_skip_verify = false
## Optional SASL Config
# sasl_username = "kafka"
# sasl_password = "secret"
## Data format to output.
## Each data format has its own unique set of configuration options, read
## more about them here:
...
...
@@ -129,6 +138,12 @@ func (k *Kafka) Connect() error {
config
.
Net
.
TLS
.
Enable
=
true
}
if
k
.
SASLUsername
!=
""
&&
k
.
SASLPassword
!=
""
{
config
.
Net
.
SASL
.
User
=
k
.
SASLUsername
config
.
Net
.
SASL
.
Password
=
k
.
SASLPassword
config
.
Net
.
SASL
.
Enable
=
true
}
producer
,
err
:=
sarama
.
NewSyncProducer
(
k
.
Brokers
,
config
)
if
err
!=
nil
{
return
err
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment