Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coerce_values issue #88

Open
vitcon-iot opened this issue Feb 11, 2020 · 0 comments
Open

coerce_values issue #88

vitcon-iot opened this issue Feb 11, 2020 · 0 comments

Comments

@vitcon-iot
Copy link

vitcon-iot commented Feb 11, 2020

Please post all product and debugging questions on our forum. Your questions will reach our wider community members there, and if we confirm that there is a bug, then we can open a new issue here.

For all general issues, please provide the following details for fast resolution:

  • Version: 5.0.5
  • Operating System: centOS8
  • Config File (if you have sensitive info, please remove it):
    influxdb {
    myHash['sensortype'] = sensortype
    70 myHash['coercetype'] = ''
    71 if sensortype == 'i'
    72 myHash['coercetype'] = 'integer'
    73 elsif sensortype =='f'
    74 myHash['coercetype'] = 'float'
    75 end
    76 myHash['prefix'] = prefix
    77 sensors.push(myHash)

173 db => "xxxxx"
174 host => "xxxxx"
175 measurement => "%{[sensor][prefix]}.%{[sensor][key]}"
176 user => "xxxxx"
177 password => "xxxxx"
178 port => "xxxxx"
179 send_as_tags => ["gatewayId"]
180 data_points => {
181 "hostname" => "%{[host]}"
182 "gatewayId" => "%{[gatewayId]}"
183 "status" => "%{[sensor][value]}"
184 }
185 coerce_values => {
186 "status" => "%{[sensor][coercetype]}"
187 }
188 }
189 }

- Sample Data:
this is std output--- debug
"host" => "xxx",
"type" => "xxxx",
"sensor" => {
"value" => 17.1,
"key" => "30AEA4C519C9-temperature_f-1",
"sensortype" => "f",
"coercetype" => "float",
"prefix" => "series",
"time" => 1581066461321

  • Steps to Reproduce:

warnnning message
[2020-02-11T20:11:26,421][WARN ][logstash.outputs.influxdb][main] Don't know how to convert to %{[sensor][coercetype]}. Returning value unchanged
[2020-02-11T20:11:26,834][WARN ][logstash.outputs.influxdb][main] Don't know how to convert to %{[sensor][coercetype]}. Returning value unchanged

influxdb field type
fieldKey fieldType


hostname string
status string

Hello
I used coerce_values ​​because I want to dynamically give field type per measurement
A warning has occurred as shown below.
Have I missed anything? Is the grammar wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant