Skip to content

x-pack/filebeat/input/{azureblobstorage, gcs}: Remove leading BOM from JSON text#47508

Merged
kcreddy merged 3 commits intoelastic:mainfrom
kcreddy:handle-bom
Nov 10, 2025
Merged

x-pack/filebeat/input/{azureblobstorage, gcs}: Remove leading BOM from JSON text#47508
kcreddy merged 3 commits intoelastic:mainfrom
kcreddy:handle-bom

Conversation

@kcreddy
Copy link
Contributor

@kcreddy kcreddy commented Nov 7, 2025

Proposed commit message

x-pack/filebeat/input/{azureblobstorage, gcs}: Remove leading BOM from JSON text

When parsing JSON leading BOMs are identified in azureblobstorage 
input. Currently the input cannot handle this and fails indicating a 
malformed JSON but without the position and characters leading 
to the failure. 

This PR handle the leading BOMs in JSON and removes them in 
azureblobstorage input. Also improve error reporting from malformed
JSON. Since a similar handling is observed in GCS input, the change 
is replicated there.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@kcreddy kcreddy requested a review from a team as a code owner November 7, 2025 09:11
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
@mergify
Copy link
Contributor

mergify bot commented Nov 7, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @kcreddy? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.
@mergify mergify bot assigned kcreddy Nov 7, 2025
@kcreddy kcreddy added Filebeat Filebeat backport-9.0 Automated backport to the 9.0 branch backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch backport-9.2 Automated backport to the 9.2 branch bugfix Team:Security-Service Integrations Security Service Integrations Team and removed backport-9.0 Automated backport to the 9.0 branch labels Nov 7, 2025
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 7, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@kcreddy kcreddy changed the title x-pack/filebeat/input/azureblobstorage: Handle and remove BOM form JSON Nov 7, 2025
@kcreddy kcreddy changed the title x-pack/filebeat/input/azureblobstorage: Remove leading BOM from JSON text Nov 7, 2025
@kcreddy kcreddy requested a review from efd6 November 7, 2025 09:32
@kcreddy kcreddy requested a review from efd6 November 10, 2025 07:01
@kcreddy kcreddy merged commit 823ee2a into elastic:main Nov 10, 2025
36 of 39 checks passed
mergify bot pushed a commit that referenced this pull request Nov 10, 2025
…m JSON text (#47508)

x-pack/filebeat/input/{azureblobstorage, gcs}: Remove leading BOM from JSON text

When parsing JSON leading BOMs are identified in azureblobstorage
input. Currently the input cannot handle this and fails indicating a
malformed JSON but without the position and characters leading
to the failure.

This PR handle the leading BOMs in JSON and removes them in
azureblobstorage input. Also improve error reporting from malformed
JSON. Since a similar handling is observed in GCS input, the change
is replicated there.

(cherry picked from commit 823ee2a)
mergify bot pushed a commit that referenced this pull request Nov 10, 2025
…m JSON text (#47508)

x-pack/filebeat/input/{azureblobstorage, gcs}: Remove leading BOM from JSON text

When parsing JSON leading BOMs are identified in azureblobstorage
input. Currently the input cannot handle this and fails indicating a
malformed JSON but without the position and characters leading
to the failure.

This PR handle the leading BOMs in JSON and removes them in
azureblobstorage input. Also improve error reporting from malformed
JSON. Since a similar handling is observed in GCS input, the change
is replicated there.

(cherry picked from commit 823ee2a)
mergify bot pushed a commit that referenced this pull request Nov 10, 2025
…m JSON text (#47508)

x-pack/filebeat/input/{azureblobstorage, gcs}: Remove leading BOM from JSON text

When parsing JSON leading BOMs are identified in azureblobstorage
input. Currently the input cannot handle this and fails indicating a
malformed JSON but without the position and characters leading
to the failure.

This PR handle the leading BOMs in JSON and removes them in
azureblobstorage input. Also improve error reporting from malformed
JSON. Since a similar handling is observed in GCS input, the change
is replicated there.

(cherry picked from commit 823ee2a)
kcreddy added a commit that referenced this pull request Nov 10, 2025
…m JSON text (#47508) (#47543)

x-pack/filebeat/input/{azureblobstorage, gcs}: Remove leading BOM from JSON text

When parsing JSON leading BOMs are identified in azureblobstorage
input. Currently the input cannot handle this and fails indicating a
malformed JSON but without the position and characters leading
to the failure.

This PR handle the leading BOMs in JSON and removes them in
azureblobstorage input. Also improve error reporting from malformed
JSON. Since a similar handling is observed in GCS input, the change
is replicated there.

(cherry picked from commit 823ee2a)

Co-authored-by: Krishna Chaitanya Reddy Burri <krishnachaitanyareddy.burri@elastic.co>
kcreddy added a commit that referenced this pull request Nov 10, 2025
…m JSON text (#47508) (#47542)

x-pack/filebeat/input/{azureblobstorage, gcs}: Remove leading BOM from JSON text

When parsing JSON leading BOMs are identified in azureblobstorage
input. Currently the input cannot handle this and fails indicating a
malformed JSON but without the position and characters leading
to the failure.

This PR handle the leading BOMs in JSON and removes them in
azureblobstorage input. Also improve error reporting from malformed
JSON. Since a similar handling is observed in GCS input, the change
is replicated there.

(cherry picked from commit 823ee2a)

Co-authored-by: Krishna Chaitanya Reddy Burri <krishnachaitanyareddy.burri@elastic.co>
kcreddy added a commit that referenced this pull request Nov 10, 2025
…m JSON text (#47508) (#47544)

x-pack/filebeat/input/{azureblobstorage, gcs}: Remove leading BOM from JSON text

When parsing JSON leading BOMs are identified in azureblobstorage
input. Currently the input cannot handle this and fails indicating a
malformed JSON but without the position and characters leading
to the failure.

This PR handle the leading BOMs in JSON and removes them in
azureblobstorage input. Also improve error reporting from malformed
JSON. Since a similar handling is observed in GCS input, the change
is replicated there.

(cherry picked from commit 823ee2a)

Co-authored-by: Krishna Chaitanya Reddy Burri <krishnachaitanyareddy.burri@elastic.co>
andrzej-stencel pushed a commit to andrzej-stencel/beats that referenced this pull request Dec 1, 2025
…m JSON text (elastic#47508)

x-pack/filebeat/input/{azureblobstorage, gcs}: Remove leading BOM from JSON text

When parsing JSON leading BOMs are identified in azureblobstorage 
input. Currently the input cannot handle this and fails indicating a 
malformed JSON but without the position and characters leading 
to the failure. 

This PR handle the leading BOMs in JSON and removes them in 
azureblobstorage input. Also improve error reporting from malformed
JSON. Since a similar handling is observed in GCS input, the change 
is replicated there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch backport-9.2 Automated backport to the 9.2 branch bugfix Filebeat Filebeat Team:Security-Service Integrations Security Service Integrations Team

3 participants