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
8f98c20c
Commit
8f98c20c
authored
9 years ago
by
张光权
Committed by
Cameron Sparr
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add flags -usage-list to print all plugins inputs for telegraf
parent
1c76d5d0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/telegraf/telegraf.go
+10
-1
10 additions, 1 deletion
cmd/telegraf/telegraf.go
with
10 additions
and
1 deletion
cmd/telegraf/telegraf.go
+
10
−
1
View file @
8f98c20c
...
@@ -11,7 +11,7 @@ import (
...
@@ -11,7 +11,7 @@ import (
"github.com/influxdata/telegraf/agent"
"github.com/influxdata/telegraf/agent"
"github.com/influxdata/telegraf/internal/config"
"github.com/influxdata/telegraf/internal/config"
"github.com/influxdata/telegraf/plugins/inputs"
_
"github.com/influxdata/telegraf/plugins/inputs/all"
_
"github.com/influxdata/telegraf/plugins/inputs/all"
_
"github.com/influxdata/telegraf/plugins/outputs/all"
_
"github.com/influxdata/telegraf/plugins/outputs/all"
)
)
...
@@ -34,6 +34,7 @@ var fOutputFilters = flag.String("output-filter", "",
...
@@ -34,6 +34,7 @@ var fOutputFilters = flag.String("output-filter", "",
"filter the outputs to enable, separator is :"
)
"filter the outputs to enable, separator is :"
)
var
fUsage
=
flag
.
String
(
"usage"
,
""
,
var
fUsage
=
flag
.
String
(
"usage"
,
""
,
"print usage for a plugin, ie, 'telegraf -usage mysql'"
)
"print usage for a plugin, ie, 'telegraf -usage mysql'"
)
var
fUsageList
=
flag
.
Bool
(
"usage-list"
,
false
,
"print all the plugins inputs"
)
var
fInputFiltersLegacy
=
flag
.
String
(
"filter"
,
""
,
var
fInputFiltersLegacy
=
flag
.
String
(
"filter"
,
""
,
"filter the inputs to enable, separator is :"
)
"filter the inputs to enable, separator is :"
)
...
@@ -61,6 +62,7 @@ The flags are:
...
@@ -61,6 +62,7 @@ The flags are:
-input-filter filter the input plugins to enable, separator is :
-input-filter filter the input plugins to enable, separator is :
-output-filter filter the output plugins to enable, separator is :
-output-filter filter the output plugins to enable, separator is :
-usage print usage for a plugin, ie, 'telegraf -usage mysql'
-usage print usage for a plugin, ie, 'telegraf -usage mysql'
-usage-list print all the plugins input
-debug print metrics as they're generated to stdout
-debug print metrics as they're generated to stdout
-quiet run in quiet mode
-quiet run in quiet mode
-version print the version to stdout
-version print the version to stdout
...
@@ -135,6 +137,13 @@ func main() {
...
@@ -135,6 +137,13 @@ func main() {
return
return
}
}
if
*
fUsageList
{
fmt
.
Println
(
"The plugin inputs avaiable:"
)
for
k
,
_
:=
range
inputs
.
Inputs
{
fmt
.
Printf
(
" %s
\n
"
,
k
)
}
}
var
(
var
(
c
*
config
.
Config
c
*
config
.
Config
err
error
err
error
...
...
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