Giter Club home page Giter Club logo

Comments (8)

telegraf-tiger avatar telegraf-tiger commented on June 11, 2024

Hello! I recommend posting this question in our Community Slack or Community Forums, we have a lot of talented community members there who could help answer your question more quickly. You can also learn more about Telegraf by enrolling at InfluxDB University for free!

Heads up, this issue will be automatically closed after 7 days of inactivity. Thank you!

from telegraf.

powersj avatar powersj commented on June 11, 2024

what is the issue here ? Why i am not able to see any data in my influxdb bucket.

Take a look at this message:

No metrics were created from a message. Verify your parser settings. This message is only printed once.

Your config does not specify any fields or tags to generate your metric from, hence no metric was created. You need to specify at least one field.

from telegraf.

sayaligo avatar sayaligo commented on June 11, 2024

Thanks !! I am new to this. do you mean i need to specify below ?

[[inputs.mqtt_consumer.topic_parsing]]

topic = ""

measurement = ""

tags = ""

fields = ""

what would come in tags/fields in my case ?

from telegraf.

powersj avatar powersj commented on June 11, 2024

do you mean i need to specify below ?

No not topic parsing, but configuration of your xpath_protobuf config. Backing up, you are sending abritrary data to Telegraf. Telegraf has no idea what your data looks like, what fields you are interested in, or how to parse the data. So your xpath config needs to grow to teach telegraf how to parse the metrics you are sending and how to generate metrics from that data. This is essentially the topic of parsing data.

In your case, you are using the xpath parser, so need to define some specific fields and optionally some tags like:

[inputs.mqtt_consumer.xpath.fields]
  myfeild = "..."

[inputs.mqtt_consumer.xpath.tags]
  name   = "substring-after(Sensor/@name, ' ')"

What I would do is:

  1. Is set xpath_print_document = true so you can see what data you are getting.
  2. Then determine the paths to fields you want and define them as fields
  3. Do the same for tags
  4. Determine if your data has a timestamp you want to parse and as such also configure how to parse that timestamp.

If you share the output of your topic, and what data you want we could possible help, but I'll take this over to the Slack thread where more than just me can help.

from telegraf.

sayaligo avatar sayaligo commented on June 11, 2024

In my proto file i have many fields(battery, current etc.) in message Vehicle- one of them is Speed for which i am providing some value at the moment.
below is the ouput i see in telegraf logs -
XML document equivalent: "<?xml version= "1.0"? > < Speed > 25 < / Speed > "

from telegraf.

srebhan avatar srebhan commented on June 11, 2024

@sayaligo This line

xpath_protobuf_import_paths = ["C:\Program Files\telegraf-1.30.1\Types"]

contains backslashes, so you need to use single-quotes in TOML or double backslashes to get what you want. Please try with

xpath_protobuf_import_paths = ['C:\Program Files\telegraf-1.30.1\Types']

from telegraf.

sayaligo avatar sayaligo commented on June 11, 2024

@srebhan isn't it the same thing ? I tried what you suggested but still I cannot see the respective messages in influxdb.

from telegraf.

srebhan avatar srebhan commented on June 11, 2024

@sayaligo it is not. If you use single quotes in TOML this denotes a 'literal' string while double-quotes are interpreted. You can even see this in the github comment above, for double quotes \P and \T are escape sequences and will NOT result in a backslash.

I tried what you suggested but still I cannot see the respective messages in influxdb.

Could you please check with a file output if Telegraf generates metrics! I guess not, given that the XML is empty...
Could you provide the .proto file(s) and a (redacted) sample of the input!?

from telegraf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.