elastic / elastic/logstash

Invalid handling of floats after Redis input

Open
#5,808 6 comments 0 reactions 2 assignees Claimed by @andrewvc View on GitHub
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
1d 4h
Merged PRs (30d)
88

Description

- Version: 2.3.4
- Operating System: CentOs 6.6

Seeing strange issue which was not there with 1.4.2.

Pipeline:

`agent --> Redis --> server --> PagerDuty`

Agent output is this:

`"test_client" => "opt is 96.0% used."`

Server reads this from Redis and sends this message to PagerDuty:

`"test_server" => "opt is 0.96E2% used."`

Mention how float was converted to scientific notation for some reason. I can see that it displays properly in Redis (96.0%) but once it gets to the server side it converts it to scientific notation which is not needed at all in this case.

This worked with no issue with Logstash 1.4.2. Something changed in a way Logstash handles floats while reading this from Redis.

Simple fix for that is (on the server side):

`mutate {
convert => { "used_percentage" => "float" }
}`

Which does solve the incorrect display issue but why do I need to convert this twice - once on a client and once more time on the server? Does not look to be very efficient.

Related to https://github.com/elastic/logstash/issues/5631

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.