-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
x-pack/metricbeat/module/sql: Fix bad type handling for sql module #40048
base: main
Are you sure you want to change the base?
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
ret["keyword"] = stringMetrics | ||
} | ||
|
||
if len(boolMetrics) > 0 { | ||
ret["bool"] = boolMetrics | ||
ret["boolean"] = boolMetrics | ||
} | ||
if len(dateMetrics) > 0 { | ||
ret["date"] = dateMetrics | ||
} | ||
if len(objectMetrics) > 0 { | ||
ret["object"] = objectMetrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decided on these keys from ES docs. Not sure why it was previously "string" and not "keyword" (or "bool" and not "boolean".
Here: https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html
case float64: | ||
numericMetrics[k] = v | ||
switch val := v.(type) { | ||
case float32, float64, int16, int32, int64, uint32, uint64: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add all those types present in numeric
case uint: | ||
return uint64(val) | ||
case uint32: | ||
return uint64(val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this as uint64 is only supported in numeric. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html
So typecasted uint32 -> uint64
Proposed commit message
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs