# Configure influxdb cloud to connect to ttn

**URL:** <https://community.influxdata.com/t/configure-influxdb-cloud-to-connect-to-ttn/25383>\
**Category:** Systems\
**Created:** [June 11, 2022, 4:08pm UTC](https://community.influxdata.com/t/configure-influxdb-cloud-to-connect-to-ttn/25383 "2022-06-11T16:08:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![uptones](https://avatars.discourse-cdn.com/v4/letter/u/71c47a/32.png) [@uptones](https://community.influxdata.com/u/uptones)\
**Post date:** [June 11, 2022, 4:08pm UTC](https://community.influxdata.com/t/configure-influxdb-cloud-to-connect-to-ttn/25383/1 "2022-06-11T16:08:21Z")

</div>

Newbie here, i am trying to connect my ttn to influxdb cloud but get the following response in my command window

Error getting HTTP config

here is my conf. file. I have used \*\*\*\* to redact user info.

# Telegraf Configuration

# 

# Telegraf is entirely plugin driven. All metrics are gathered from the

# declared inputs, and sent to the declared outputs.

# 

# Plugins must be declared in here to be active.

# To deactivate a plugin, comment out the name and any variables.

# 

# Use ‘telegraf -config telegraf.conf -test’ to see what metrics a config

# file would generate.

# 

# Environment variables can be used anywhere in this config file, simply surround

# them with ${}. For strings the variable must be within quotes (ie, “${STR\_VAR}”),

# for numbers and booleans they should be plain (ie, ${INT\_VAR}, ${BOOL\_VAR})

# Global tags can be specified here in key=“value” format.

[global\_tags]

# dc = “us-east-1” # will tag all metrics with dc=us-east-1

# rack = “1a”

## Environment variables can be used as tags, and throughout the config file

# user = “$USER”

# Configuration for telegraf agent

[agent]

## Default data collection interval for all inputs

interval = “5s”

## Rounds collection interval to ‘interval’

## ie, if interval=“10s” then always collect on :00, :10, :20, etc.

round\_interval = true

## Telegraf will send metrics to outputs in batches of at most

## metric\_batch\_size metrics.

## This controls the size of writes that Telegraf sends to output plugins.

metric\_batch\_size = 1000

## Maximum number of unwritten metrics per output. Increasing this value

## allows for longer periods of output downtime without dropping metrics at the

## cost of higher maximum memory usage.

metric\_buffer\_limit = 10000

## 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 = “5s”

## Default flushing interval for all outputs. Maximum flush\_interval will be

## flush\_interval + flush\_jitter

flush\_interval = “10s”

## Jitter the flush interval by a random amount. This is primarily to avoid

## large write spikes for users running a large number of telegraf instances.

## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s

flush\_jitter = “5s”

## By default or when set to “0s”, precision will be set to the same

## timestamp order as the collection interval, with the maximum being 1s.

## ie, when interval = “10s”, precision will be “1s”

## when interval = “250ms”, precision will be “1ms”

## Precision will NOT be used for service inputs. It is up to each individual

## service input to set the timestamp at the appropriate precision.

## Valid time units are “ns”, “us” (or “µs”), “ms”, “s”.

precision = “”

## 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

debug = true

quiet = false

###############################################################################

# OUTPUT PLUGINS

###############################################################################

# Configuration for sending metrics to InfluxDB 2.0

[[outputs.influxdb\_v2]]  
alias = “thing\_network\_stats\_bucket”  
namepass = [“thing\_network”]

## 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](https://us-west-2-1.aws.cloud2.influxdata.com)”]

urls = [“[https://ap-southeast-2-1.aws.cloud2.influxdata.com](https://ap-southeast-2-1.aws.cloud2.influxdata.com)”]

## Token for authentication.

token = “wHchm45k5bnp\_8EpOJPKCwWW\*\*\*\*xN8cIg9vVnERnjP7YrNnZ7e0vsA==”

## Organization is the name of the organization you wish to write to.

organization = “\*\*@\*.com”

## Destination bucket to write into.

bucket = “${INFLUX\_BUCKET}”

###############################################################################

# INPUT PLUGINS

###############################################################################  
#THING NETWORK META DATA#  
[[inputs.mqtt\_consumer]]  
alias = “thing\_network\_consumer”  
name\_override = “thing\_network”  
servers = [“tcp://au1.cloud.thethings.network:1883”]  
topics = [“#”]  
max\_undelivered\_messages = 1

```
username = " **** @ttn"
password = "NNSXS.TMZJHKDKM7H5YN44NIIW343 **** AVCM6CKHLJX62Q3PRX55FI2KPPE6RY2OQ" 
data_format = "json_v2"

```

[[inputs.mqtt\_consumer.json\_v2]]  
[[inputs.mqtt\_consumer.json\_v2.tag]]  
path = “@this.end\_device\_ids.device\_id”

[[inputs.mqtt\_consumer.json\_v2.object]]  
path = “end\_device\_ids”  
disable\_prepend\_keys = true

[[inputs.mqtt\_consumer.json\_v2.object]]  
path = “uplink\_message”  
disable\_prepend\_keys = true  
excluded\_keys = [“time”, “timestamp”]

[[inputs.mqtt\_consumer.json\_v2.object]]  
path = “uplink\_message.rx\_metadata”  
disable\_prepend\_keys = true  
excluded\_keys = [“time”, “timestamp”]

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [June 13, 2022, 9:39pm UTC](https://community.influxdata.com/t/configure-influxdb-cloud-to-connect-to-ttn/25383/2 "2022-06-13T21:39:20Z")

</div>

Hello @uptones,  
Can you please include more of the logs?  
You might want to check out

> **[GitHub - InfluxCommunity/Telegraf-Community-Configs: The purpose of this...](https://github.com/InfluxCommunity/Telegraf-Community-Configs)**
>
> The purpose of this repository is to promote the creation, sharing, and reuse of configs among the Telegraf community. Anybody can submit new configs or improvements upon existing configs and use t...

By the amazing @Jay_Clifford–ps have you encountered this before?

---

<div class="post-metadata">

**Author:** ![Jay\_Clifford](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jay_clifford/32/8287_2.png) [@Jay\_Clifford](https://community.influxdata.com/u/Jay_Clifford)\
**Post date:** [June 14, 2022, 7:41am UTC](https://community.influxdata.com/t/configure-influxdb-cloud-to-connect-to-ttn/25383/3 "2022-06-14T07:41:14Z")

</div>

Hi @uptones,  
Welcome to the community and great to see you are using ttn. I am also a massive fan!

I agree with @Anaisdg, would be great to see some more logs to understand the issue you are facing. It sounds like an invalid token/bucket mismatch.

---

<div class="post-metadata">

**Author:** ![uptones](https://avatars.discourse-cdn.com/v4/letter/u/71c47a/32.png) [@uptones](https://community.influxdata.com/u/uptones)\
**Post date:** [June 14, 2022, 5:21pm UTC](https://community.influxdata.com/t/configure-influxdb-cloud-to-connect-to-ttn/25383/4 "2022-06-14T17:21:25Z")

</div>

Hi Anais and Jay, thanks for getting back to me.

Where do i find these logs you speak of? Sorry im very new to this!  
I have multiple applications waiting however so i am very eager to understand how this all works.  
Perhaps you could answer some of my other questions and they will help with my overall understanding.

What is the standard process for running a service with telegraf into influx using windows 10?  
Do this, then do this, then do this… etc

Should i use CMD or Powershell?

Where is a list of commands used to run telegraf and what they do? For example I found this:  
[\> telegraf.exe --service start] but how do i stop? can i stop? will it keep running in the background if i close CMD/powershell?

Can i have multiple conf. files in my telegraf folder or do i need to only just have the one being used?

Why is there not more detailed information about what needs to be changed in the conf. files?

Thanks again, i appreciate any help you can offer. I will post the logs if you tell me where i can find them.

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [June 14, 2022, 5:35pm UTC](https://community.influxdata.com/t/configure-influxdb-cloud-to-connect-to-ttn/25383/5 "2022-06-14T17:35:06Z")

</div>

Hello @uptones,  
The same place you got your first error  
Error getting HTTP config  
We’re just looking for all of the logs.

---

<div class="post-metadata">

**Author:** ![uptones](https://avatars.discourse-cdn.com/v4/letter/u/71c47a/32.png) [@uptones](https://community.influxdata.com/u/uptones)\
**Post date:** [June 14, 2022, 6:02pm UTC](https://community.influxdata.com/t/configure-influxdb-cloud-to-connect-to-ttn/25383/6 "2022-06-14T18:02:18Z")

</div>

![Capture](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/4/4014c529873f04b1b3663a3a37cdc53fcff097ec.png)

---

<div class="post-metadata">

**Author:** ![Jay\_Clifford](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jay_clifford/32/8287_2.png) [@Jay\_Clifford](https://community.influxdata.com/u/Jay_Clifford)\
**Post date:** [June 15, 2022, 9:21am UTC](https://community.influxdata.com/t/configure-influxdb-cloud-to-connect-to-ttn/25383/7 "2022-06-15T09:21:16Z")

</div>

Hi @uptones,  
So that looks to be an unauthorized access error. This looks like you don’t have permission to access the Telegraf config from your InfluxDB Cloud account. Please make sure you use the token generated by InfluxDB when using the wizard for creation (see screenshot). This token provides the necessary permissions to allow Telegraf to access your InfluxDB account. Make sure to add the token to a windows environment variable. `export` will not work within Windows.

You can find quite a bit of documentation here:

- [Run Telegraf as a Windows service | Telegraf 1.21 Documentation](https://docs.influxdata.com/telegraf/v1.21/administration/windows_service/)

Your other option is to create the configs locally ( which I recommend). You can find some best practises here: [Telegraf Best Practices: Config Recommendations and Performance Monitoring | InfluxData](https://www.influxdata.com/blog/telegraf-best-practices/)

I also recommend taking our Telegraf course on InfluxDB University to get you started.
