From dba873cf2c0149e8d33adc8e51b542fb1d280547 Mon Sep 17 00:00:00 2001 From: Sven Rebhan <36194019+srebhan@users.noreply.github.com> Date: Wed, 28 Jun 2023 13:53:04 +0200 Subject: [PATCH] fix(serializers.splunkmetric): Fix TOML option name for multi-metric (#13511) --- plugins/serializers/splunkmetric/README.md | 61 ++++++++++--------- .../serializers/splunkmetric/splunkmetric.go | 2 +- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/plugins/serializers/splunkmetric/README.md b/plugins/serializers/splunkmetric/README.md index 27fdee76d..b91c54e59 100644 --- a/plugins/serializers/splunkmetric/README.md +++ b/plugins/serializers/splunkmetric/README.md @@ -66,42 +66,43 @@ to manage the HEC authorization, here's a sample config for an HTTP output: ```toml [[outputs.http]] - ## URL is the address to send metrics to - url = "https://localhost:8088/services/collector" + ## URL is the address to send metrics to + url = "https://localhost:8088/services/collector" - ## Timeout for HTTP message - # timeout = "5s" + ## Timeout for HTTP message + # timeout = "5s" - ## HTTP method, one of: "POST" or "PUT" - # method = "POST" + ## HTTP method, one of: "POST" or "PUT" + # method = "POST" - ## HTTP Basic Auth credentials - # username = "username" - # password = "pa$$word" + ## HTTP Basic Auth credentials + # username = "username" + # password = "pa$$word" - ## Optional TLS Config - # tls_ca = "/etc/telegraf/ca.pem" - # tls_cert = "/etc/telegraf/cert.pem" - # tls_key = "/etc/telegraf/key.pem" - ## Use TLS but skip chain & host verification - # insecure_skip_verify = false + ## Optional TLS Config + # tls_ca = "/etc/telegraf/ca.pem" + # tls_cert = "/etc/telegraf/cert.pem" + # tls_key = "/etc/telegraf/key.pem" + ## Use TLS but skip chain & host verification + # insecure_skip_verify = false - ## Data format to output. - ## Each data format has it's own unique set of configuration options, read - ## more about them here: - ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md - data_format = "splunkmetric" - ## Provides time, index, source overrides for the HEC - splunkmetric_hec_routing = true - # splunkmetric_multimetric = true - # splunkmetric_omit_event_tag = false + ## Data format to output. + ## Each data format has it's own unique set of configuration options, read + ## more about them here: + ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md + data_format = "splunkmetric" - ## 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" + ## Provides time, index, source overrides for the HEC + splunkmetric_hec_routing = true + # splunkmetric_multimetric = true + # splunkmetric_omit_event_tag = false + + ## 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 diff --git a/plugins/serializers/splunkmetric/splunkmetric.go b/plugins/serializers/splunkmetric/splunkmetric.go index de6dfa561..21e8681ec 100644 --- a/plugins/serializers/splunkmetric/splunkmetric.go +++ b/plugins/serializers/splunkmetric/splunkmetric.go @@ -10,7 +10,7 @@ import ( type Serializer struct { HecRouting bool `toml:"splunkmetric_hec_routing"` - MultiMetric bool `toml:"splunkmetric_multi_metric"` + MultiMetric bool `toml:"splunkmetric_multimetric"` OmitEventTag bool `toml:"splunkmetric_omit_event_tag"` }