fix(serializers.splunkmetric): Fix TOML option name for multi-metric (#13511)

This commit is contained in:
Sven Rebhan 2023-06-28 13:53:04 +02:00 committed by GitHub
parent ef86635d21
commit dba873cf2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 31 deletions

View File

@ -66,42 +66,43 @@ to manage the HEC authorization, here's a sample config for an HTTP output:
```toml ```toml
[[outputs.http]] [[outputs.http]]
## URL is the address to send metrics to ## URL is the address to send metrics to
url = "https://localhost:8088/services/collector" url = "https://localhost:8088/services/collector"
## Timeout for HTTP message ## Timeout for HTTP message
# timeout = "5s" # timeout = "5s"
## HTTP method, one of: "POST" or "PUT" ## HTTP method, one of: "POST" or "PUT"
# method = "POST" # method = "POST"
## HTTP Basic Auth credentials ## HTTP Basic Auth credentials
# username = "username" # username = "username"
# password = "pa$$word" # password = "pa$$word"
## Optional TLS Config ## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem" # tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem" # tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem" # tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification ## Use TLS but skip chain & host verification
# insecure_skip_verify = false # insecure_skip_verify = false
## Data format to output. ## Data format to output.
## Each data format has it's own unique set of configuration options, read ## Each data format has it's own unique set of configuration options, read
## more about them here: ## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
data_format = "splunkmetric" data_format = "splunkmetric"
## Provides time, index, source overrides for the HEC
splunkmetric_hec_routing = true
# splunkmetric_multimetric = true
# splunkmetric_omit_event_tag = false
## Additional HTTP headers ## Provides time, index, source overrides for the HEC
[outputs.http.headers] splunkmetric_hec_routing = true
# Should be set manually to "application/json" for json data_format # splunkmetric_multimetric = true
Content-Type = "application/json" # splunkmetric_omit_event_tag = false
Authorization = "Splunk xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
X-Splunk-Request-Channel = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ## Additional HTTP headers
[outputs.http.headers]
# Should be set manually to "application/json" for json data_format
Content-Type = "application/json"
Authorization = "Splunk xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
X-Splunk-Request-Channel = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
``` ```
## Overrides ## Overrides

View File

@ -10,7 +10,7 @@ import (
type Serializer struct { type Serializer struct {
HecRouting bool `toml:"splunkmetric_hec_routing"` HecRouting bool `toml:"splunkmetric_hec_routing"`
MultiMetric bool `toml:"splunkmetric_multi_metric"` MultiMetric bool `toml:"splunkmetric_multimetric"`
OmitEventTag bool `toml:"splunkmetric_omit_event_tag"` OmitEventTag bool `toml:"splunkmetric_omit_event_tag"`
} }