-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtelegraf_template.conf
111 lines (85 loc) · 3.41 KB
/
telegraf_template.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Configuration for telegraf agent
[agent]
# Data collection interval for all inputs
interval = "10s"
# Rounds collection interval (ie if interval="10s" then always collect on :00, :10, :20 etc.)
round_interval = true
# This controls the size of writes that Telegraf sends to output plugins
metric_batch_size = 1000
# Collection jitter is used to jitter the collection by a random amount.
# Each plugin will sleep for a random time within jitter before collecting.
# This can be used to avoid many plugins querying things like sysfs at the
# same time, which can have a measurable effect on the system.
collection_jitter = "0s"
# Default flushing interval for all outputs. Maximum flush_interval will be
flush_interval = "10s"
flush_jitter = "0s"
precision = "0s"
# Log at debug level
debug = true
# Log only error level messages
quiet = false
## Override default hostname, if empty use os.Hostname()
hostname = ""
## If set to true, do no set the "host" tag in the telegraf agent
omit_hostname = false
# Configuration for sending metrics to InfluxDB 2.0
[[outputs.influxdb_v2]]
## The URLs of the InfluxDB cluster nodes.
## Multiple URLs can be specified for a single cluster, only ONE of the
## urls will be written to each interval.
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
urls = ["http://localhost:8086"]
## Token for authentication.
#token = "secretToken"
## Organization is the name of the organization you wish to write to.
organization = "my-org"
## Destination bucket to write into.
bucket = "my-bucket"
## The value of this tag will be used to determine the bucket. If this
## tag is not set the 'bucket' option is used as the default.
# bucket_tag = ""
## If true, the bucket tag will not be added to the metric.
# exclude_bucket_tag = false
## Timeout for HTTP messages.
# timeout = "5s"
## Additional HTTP headers
# http_headers = {"X-Special-Header" = "Special-Value"}
## HTTP Proxy override, if unset values the standard proxy environment
## variables are consulted to determine which proxy, if any, should be used.
# http_proxy = "http://corporate.proxy:3128"
## HTTP User-Agent
# user_agent = "telegraf"
## Content-Encoding for write request body, can be set to "gzip" to
## compress body or "identity" to apply no encoding.
# content_encoding = "gzip"
## Enable or disable uint support for writing uints influxdb 2.0.
# influx_uint_support = false
## Optional TLS Config for use on HTTP connections.
# 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
# # Convert values to another metric value type
[[processors.converter]]
[processors.converter.fields]
integer = ["temperature", "humidity", "pressure", "light"]
# Configuration of MQTT topics to read metrics from
[[inputs.mqtt_consumer]]
servers = ["ssl://localhost:8883"]
topics = [
"my-topic-1",
"my-topic-2"
]
insecure_skip_verify = true
tls_ca = "/etc/ssl/ca.crt"
tls_cert = "/etc/ssl/telegraf.crt"
tls_key = "/etc/ssl/telegraf.key"
data_format = "json"
json_string_fields = ["temperature", "humidity", "pressure", "light"]
connection_timeout = "20s"
[[inputs.mqtt_consumer.topic_parsing]]
topic = "weather/#"
measurement = "measurement/_"
tags = "_/device"