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

Elasticsearch integration: every field is sent as String #29

Open
enoquefcd opened this issue Oct 22, 2018 · 0 comments
Open

Elasticsearch integration: every field is sent as String #29

enoquefcd opened this issue Oct 22, 2018 · 0 comments

Comments

@enoquefcd
Copy link

enoquefcd commented Oct 22, 2018

When moskito-central sends the producers information to elasticSearch (using v5.6.12), every field reaches elasticSearch as a String field, including number and date fields, which makes it basicly useless because kibana can't make any countable visualization over String fields. I don't know if elasticsearch requires us to send the fields with a specified type along with the field, or if its just a case of sending : 123 instead of "123" on the json fields.

EDIT: I just noticed that just sending 123 instead of "123" on the request json to elasticsearch is enough, for a provisory solution, I just edited the ElasticsearchStorage.httpProcessSnapshot() method to convert the stats to Map<String, Object> instead of Map<String, String>, and convert the number strings to bigdecimal,, then the gson.toJson() will convert the types correctly,,, ill try this soon for dates too

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