Can't see metrics on InfluxDB coming from telegraf

I have the latest version of telegraf and the latest version of InfluxDB set up so that telegraf will send data from a file to InfluxDB, however even though after using debug mode, it says that both the input and the output are connected successfully and I can see the metrics being pulled from my file when I use test; I cannot see the metrics being pushed to InfluxDB. Please help!!!


Can you please share your telegraf logs with debug mode enabled? With debug enabled there should be a message anytime you send metrics to your output, influxdb in this case.

If possible can you also share your telegraf config?


Agent Configuration:

Hopefully this works! Thanks :slight_smile:

Sorry I have to make multiple posts since I’m a new user
Input Configuration:

Output Configuration:

The Top portion of the telegraf debug logs:

The bottom portion of the telegraf logs:

Thanks for putting up with the multiple posts. I didn’t know a better way to do it.

No worries :slight_smile: Looking at your posted logs you will see the following message at each interval:

[outputs.influxdb_v2] Wrote batch of N metrics in...

That means that Telegraf is reading your file and pushing metrics to InfluxDBv2 successfully.

When you are in InfluxDB, how are you looking up these metrics?
If you use the data explorer, do you see the metric name?
Are you sure you are using a wide enough time frame to see the metrics in the UI?

Yeah I was looking at it through the data explorer. It won’t even show me any tags in the filter section after selecting my bucket so no I can’t see any of the metric names. I’ve been sure to make my timestamp within the last 30 days and then expand the scope of the filter to be the last 30 days but nothing shows up. It just stays as shown below:

Two questions, when you output using test:

  1. do you see timestamps in the lat 30 days
  2. what tags are there?

I didn’t realize this, but all the entries are having the same timestamp. It’s weird because the timestamp key value pair isn’t showing up in the entry, but the current timestamp is being applied to all of them. Any idea as to why? Thanks!

I do have the json_time_key = “timestamp” in my telegraf config file and have confirmed that it is spelled the same way as the json log timestamp key

Are you sure your time stamp is a unix_ms? (e.g. 13 digits)?
edit: and the timestamp is not nested? it is directly available as a top level key “timestamp”?

Here’s an example of one of our logs. timestamp is not nested and is 13 digits.

It shouldn’t have the period should it…

Correct that would explain why it may be failing to parse it and then is using the current timestamp.

This was the problem and everything is working perfectly now. Thanks so much for your help!!!

1 Like