fix: preserve integer/float types in Logstash plugin serialization (#14272)#14342
Open
dcaayushd wants to merge 2 commits into
Open
fix: preserve integer/float types in Logstash plugin serialization (#14272)#14342dcaayushd wants to merge 2 commits into
dcaayushd wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR restores v1.x behavior by switching the Logstash plugin’s JSON serialization to LogStash::Json, preserving native integer/float types so DCR ingestion won’t drop strictly-typed numeric columns.
Changes:
- Replaced
.to_jsonusage withLogStash::Json.dumpacross buffering/compression/sample-file paths to preserve numeric types. - Added a minimal
LogStash::Jsonshim for the spec environment (avoids loadinglogstash-core). - Added an RSpec that validates integers/floats remain JSON numbers after serialization.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| DataConnectors/microsoft-sentinel-log-analytics-logstash-output-plugin/spec/support/logstash/json.rb | Adds a minimal LogStash::Json shim for unit tests. |
| DataConnectors/microsoft-sentinel-log-analytics-logstash-output-plugin/spec/outputs/serialization_spec.rb | Adds spec coverage asserting numeric fields remain numeric after serialization. |
| DataConnectors/microsoft-sentinel-log-analytics-logstash-output-plugin/lib/logstash/sentinel_la/sampleFileCreator.rb | Uses LogStash::Json.dump when writing sample payloads. |
| DataConnectors/microsoft-sentinel-log-analytics-logstash-output-plugin/lib/logstash/sentinel_la/logStashEventsBatcher.rb | Uses LogStash::Json.dump for document-size calculation. |
| DataConnectors/microsoft-sentinel-log-analytics-logstash-output-plugin/lib/logstash/sentinel_la/logStashCompressedStream.rb | Uses LogStash::Json.dump when adding events to the compressed stream. |
| DataConnectors/microsoft-sentinel-log-analytics-logstash-output-plugin/lib/logstash/sentinel_la/logStashAutoResizeBuffer.rb | Uses LogStash::Json.dump for payload serialization and sizing. |
| DataConnectors/microsoft-sentinel-log-analytics-logstash-output-plugin/lib/logstash/sentinel_la/customSizeBasedBuffer.rb | Uses LogStash::Json.dump for var_size calculation. |
Collaborator
|
Hi @dcaayushd, Please check Copilot’s suggestions and act accordingly. Once done, click the “Resolve conversation” button. Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change(s):
Reason for Change(s):
Version Updated:
Testing Completed:
Checked that the validations are passing and have addressed any issues that are present: