Comments (20)
@powersj the problem here is that the plugin wants to be too clever as it will detect enabled
and disabled
strings and convert them to booleans. However, there are multiple non-binary strings also containing other things like muted
... So again auto-typing bites us. :-(
The correct way would be to not do any auto-type conversions for strings, but this certainly breaks backward compatibility...
@masterwishx you might use the enum processor to convert the value. Here an untested suggestion
[[processors.enum]]
[[processors.enum.mapping]]
field = "ups_beeper_status"
default = false
[processors.enum.mapping.value_mappings]
enabled = true
disabled = false
muted = false
from telegraf.
@masterwishx we will discuss this with the team to see what's the best way forward... Will come back to you next week.
from telegraf.
@masterwishx we discussed within the team and think the best way forward is to document the current behavior including an example of how to convert back the booleans to strings using the enum
processor.
The reason for not trying to "solve" it in code is because the issue comes from the underlying library that is out of our control. Even if we are trying to be smart and convert the booleans back to strings we will break existing users. So there is really nothing we can do here. :-(
from telegraf.
@masterwishx please check if the documentation in #14938 is comprehensible! :-)
from telegraf.
So if influxdata has already written the value as a boolean, then you need to continue to pass it as a boolean.
from telegraf.
@masterwishx or you convert / drop the existing series containing the booleans...
from telegraf.
@masterwishx or you convert / drop the existing series containing the booleans...
Sure , i made new bucket ,working fine . also will try maybe to convert/drop old data ...
from telegraf.
from https://networkupstools.org/docs/developer-guide.chunked/apas02.html
from telegraf.
it seems error appear when muted
instead of enabled or disabled
from telegraf.
@srebhan @powersj can you please check this out ....
from telegraf.
I did not think we did any transformation of enabled/disabled to true or false. Were you using another collector before?
@masterwishx can you set dump_raw_variables = false
please I want to see an entry with both a disabled/enabled and one with muted.
from telegraf.
I did not think we did any transformation of enabled/disabled to true or false. Were you using another collector before?
@masterwishx can you set
dump_raw_variables = false
please I want to see an entry with both a disabled/enabled and one with muted.
Do you mean to test on windows? I was tested on windows befor...
I can check disabled/muted enabled somehow not working for me now becose of some kind of bug in upsd, when I set enabled it's goes to mute value but in real the sound is working so it's enabled
from telegraf.
disabled:
mute:
from telegraf.
In line protocol false
and true
are booleans, not strings. As a result, your very first value was probably either false
or true
and InfluxDB went "that's a boolean". Then you sent a "muted" string, which InfluxDB rejects becuase of the type conflict.
My suggestion is for you to is to use a processor in telegraf to convert the values to booleans, and/or drop your data and use a processor to convert them all to strings. For the first, you could use the strings processor to match on "muted" and change it to true/false.
@srebhan any other thoughts?
from telegraf.
In line protocol
false
andtrue
are booleans, not strings. As a result, your very first value was probably eitherfalse
ortrue
and InfluxDB went "that's a boolean". Then you sent a "muted" string, which InfluxDB rejects becuase of the type conflict.My suggestion is for you to is to use a processor in telegraf to convert the values to booleans, and/or drop your data and use a processor to convert them all to strings. For the first, you could use the strings processor to match on "muted" and change it to true/false.
@srebhan any other thoughts?
can you give an example for it please?
from telegraf.
@powersj @srebhan this should be as global variable? like this or inside the [[inputs.upsd]] ?
from telegraf.
@powersj the problem here is that the plugin wants to be too clever as it will detect
enabled
anddisabled
strings and convert them to booleans. However, there are multiple non-binary strings also containing other things likemuted
... So again auto-typing bites us. :-(The correct way would be to not do any auto-type conversions for strings, but this certainly breaks backward compatibility...
@masterwishx you might use the enum processor to convert the value. Here an untested suggestion
[[processors.enum]] [[processors.enum.mapping]] field = "ups_beeper_status" default = false [processors.enum.mapping.value_mappings] enabled = true disabled = false muted = false
Yes , This Working fine ... but if it possible to convert to string like : enabled ,disabled,muted
?
from telegraf.
@masterwishx please check if the documentation in #14938 is comprehensible! :-)
Working Fine ,Thanks
from telegraf.
@srebhan @powersj its not working in 1.29.5 ?
from telegraf.
from telegraf.
Related Issues (20)
- SQLServer plugin shows wrong latency values HOT 4
- nvidia_smi lacks power_limit for NVidia XML schema v12 HOT 2
- Ubuntu 24.04 Noble Numbat packages HOT 1
- feat(aggregators.final): Add new tag to downsampled metric HOT 2
- Redis input plugins label Mismatch HOT 3
- Got empty metric-name for response on Ciena WaveServer HOT 19
- Redis latency percentiles statistics are not parsed
- add option to disable procstat memory map collection HOT 2
- improve documentation for postgres input HOT 8
- bad handshake telegraf error for inputs.mqtt HOT 2
- [processsors.enum] allow list of fields HOT 1
- Recent telegraf versions panic when receiving invalid errorstats entries HOT 3
- Missing NetFlow IPFIX Option packets HOT 4
- [inputs.tail] Grok regex patterns not matching HOT 6
- [inputs.tail] Logs being processed everytime the agent restarts HOT 2
- Debian Server Telegraf Docker Container fails to connect to OPCUA while Ubuntu Machine connects HOT 9
- [inputs.win_eventlog] Telegraf agent not collecting custom event logs HOT 4
- chore: support new golang version 1.22.3
- Add Python example for Execd plugin HOT 1
- [documentation]: improve details on kubernetes input configuration HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegraf.