-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtelegraf.conf
61 lines (55 loc) · 2.04 KB
/
telegraf.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
###
# telegraf.conf example
# https://github.com/yjeanrenaud/BirdNET-Pi-influxdb/
# 2025, Yves Jeanrenaud
###
# ...
# all your other settings
# ...
[[inputs.mqtt_consumer]]
## FILL IN your MQTT broker’s details
servers = ["tcp://HOSTNAME:1883"]
username = "username"
password = "password"
## Topics to subscribe to
topics = ["birdnet/bird_json"]
# The topic birdnet/bird is malformed therefore. We could pare it use regexor grok in telegraf, but it's quite cumbersome, especially to debug.
# We use a python script (mqtt_json.py) to extract the message's data, as birdnet-pi sends notifications as multiline string, which is somethng grok can't handle well.
name_override = "birdnet_detection"
client_id = "telegraf"
qos = 1
persistent_session = false
data_format="json_v2"
[inputs.mqtt_consumer.tags]
destination="birdnet"
[[inputs.mqtt_consumer.json_v2]]
timestamp_path="timestamp"
timestamp_format="unix"
timestamp_timezone="Local"
[[inputs.mqtt_consumer.topic_parsing]]
topic="comname"
[[inputs.mqtt_consumer.json_v2.object]]
path ="@this"
[[inputs.mqtt_consumer.json_v2.field]]
path = "@this"
# ...
# all your other settings
# ...
[[outputs.influxdb_v2]]
### FILL IN your InfluxDB details
urls=["http://INFLUXDB"]
token="YOURapiTOKEN"
# ## Organization is the name of the organization you wish to write to.
organization="MyOrg"
# ## Destination of the default bucket to write into.
bucket="myDefaultBucketName"
# OPTIONAL: send different metrics to different topics using the bucket tag "destination".
# You can specify inputs.WHATEVER.tags a destinaton="bucketname" under each input configuration to do so.
# I chose to send birdnet metrics to the bridnet bucket and separate it therefore from other telemetry data I collect.
# If you do not need that, just comment out the following line
bucket_tag = "destination"
## bucket tag will not be added to the metric. It is just for sorting.
exclude_bucket_tag = true
# ...
# all your other settings
# ...