I’ve just setup an InfluxDB v2 server for some testing and I’m trying to configure Telegraf to default metrics to a default bucket or send specific metrics from inputs to a specific bucket. There seems to be absolutely no info on this in the Telegraf documentation. As an example, I have SNMP info I want to go to one bucket while Syslog info goes to another. I just can’t find how to setup the inputs for this or the Influxdb_v2 outputs. I see in the telegraf.conf file references this…
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 = “”
I created two instances of the InfluxDB_v2 outputs, one with this not set so that bucket identified is default. The other instance is set to a different bucket then I add the bucket_tag=“database” in my input, but that didn’t work.
Any info on how to take input sources and direct them to their own buckets would be greatly appreciated.
Hi @Franky1 , thanks for the response. Is this supported for Influxdb_v2? The examples just show [[outputs.influxdb]], also I don’t see any references to the use of buckets. TIG stack is fairly new to me so still learning.
…which references the info on your link without any success. Anything I add fails to start the Telegraf service. I even found that just enabling input.syslog by uncommenting…
server = “tcp://:6514”
…and allow it to default to the default bucket doesn’t allow the Telegraf service to start.
I uncommented the “debug = false” and changed it to “debug = true”. I had commented out all the tagging I’m trying to do as well as the syslog "server = “tcp://6514” and I am able to start the Telegraf service.
I then just uncommented the syslog entry and the Telegraf service won’t start, checking the logs has no information other then the last successful start.
Hi @Franky1, really appreciate your help. You’re right a working input needs to be available for the Telegraf service to start. I also figured out why the Telegraf service wouldn’t start, I forgot to remove the comment before the [[inputs.syslog]]. At the moment I have inlfuxdb_v2, telegraf and rsyslog services running but I am not able to get any syslog info into influxdb. I don’t think there is any use trying to sort out the data redirection to the specific database until I can get some syslog data ingesting so I’ll work on that then respond back to this thread for that part.
Ok, after messing around with it all day I finally figured out the changes I needed to get syslog messages into InfluxDB_v2. Since I have two outputs set, without successfully targeting the correct DBs I have duplicate data in the two DBs. Here are my Output Configs with some commented entries I’ve tried.
I’m trying to target basic metrics, like local CPU\Mem etc, into the InfluxDB_Server and the syslog data into the Syslog database. If I comment out “namepass = syslog” the Telegraf service won’t start.
[[outputs.influxdb_v2]]
urls = ["http://127.0.0.1:8086"]
# ## Token for authentication.
#token = "$INFLUX_TOKEN"
#urls = "$INFLUX_HOST"
#organization = "$INFLUX_ORG"
token = "7u3yFyc2FQ7iplc48_yVdrnlNSGMIo8jHK-q8ohaeyIhIgqOZKFGIuJspQnnZceCnAgT9Pd1Nbiv8Xi2dbc4ag=="
# ## Organization is the name of the organization you wish to write to; must exist.
organization = "Test_Org"
# ## Destination bucket to write into.
#[outputs.influxdb_v2.tagdrop]
# influxdb_database = ["*"]
bucket = "InfluxDB_Server"
[[outputs.influxdb_v2]]
urls = ["http://127.0.0.1:8086"]
#token = "$INFLUX_TOKEN"
#urls = "$INFLUX_HOST"
#organization = "$INFLUX_ORG"
token = "7u3yFyc2FQ7iplc48_yVdrnlNSGMIo8jHK-q8ohaeyIhIgqOZKFGIuJspQnnZceCnAgT9Pd1Nbiv8Xi2dbc4ag=="
organization = "Test_Org"
#tagexclude = ["influxdb_database"]
#[outputs.influxdb_v2.tagpass]
#influxdb_database = {"Syslog"]
#namepass = syslog
bucket = "Syslog"
#user_agent = "telegraf"
#bucket_tag = "Syslog"
#exclude_bucket_tag = true
I think I tried that before but had other issues going on at the time. I made that change and no error starting Telegraf but I’m still getting the syslog entries in both data bases.