Skip to content

[tenable_io] Coerce ratings score decimal strings to long in asset pipeline#19885

Closed
Jsmith-DigitalRealty wants to merge 1 commit into
elastic:mainfrom
Jsmith-DigitalRealty:fix/tenable_io-ratings-score-decimal-string
Closed

[tenable_io] Coerce ratings score decimal strings to long in asset pipeline#19885
Jsmith-DigitalRealty wants to merge 1 commit into
elastic:mainfrom
Jsmith-DigitalRealty:fix/tenable_io-ratings-score-decimal-string

Conversation

@Jsmith-DigitalRealty

@Jsmith-DigitalRealty Jsmith-DigitalRealty commented Jun 30, 2026

Copy link
Copy Markdown

Proposed commit message

WHAT: Replace the two convert-to-long processors for json.ratings.acr.score and json.ratings.aes.score in the tenable_io.asset ingest pipeline with script processors that coerce the value to a long, tolerating decimal-string inputs.

WHY: Tenable Vulnerability Management can emit the ACR/AES rating scores as decimal strings (e.g. "9.0" / "744.0"). The convert processor runs Long.parseLong under the hood, which throws NumberFormatException: For input string: "9.0" on any value containing a .. Each failure appended to error.message and the document was tagged event.kind: pipeline_error, so valid asset records were being demoted to failure documents.

The new script processors parse the string as a long, falling back to Double.parseDouble and truncating when a fractional part is present — mirroring the existing decimal-tolerant handling already in place for the flat acr_score / exposure_score fields. Numeric JSON inputs (integer and double) are also coerced, so existing integer payloads continue to map unchanged.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • Existing pipeline tests with integer/double/string acr_score / exposure_score inputs remain unchanged.
  • The ratings test record now sends ratings.acr.score / ratings.aes.score as decimal strings ("9.0" / "744.0") to reproduce the failure; expected output remains 9 / 744 (long).

How to test this PR locally

elastic-package test pipeline -C packages/tenable_io --data-streams asset

The test-asset.log fixture includes a record whose ratings.acr.score and ratings.aes.score arrive as decimal strings; before this change that record produced an event.kind: pipeline_error with error.message containing For input string: "9.0". After this change the scores are coerced to longs and no error is recorded.

Related issues

@Jsmith-DigitalRealty Jsmith-DigitalRealty requested review from a team as code owners June 30, 2026 14:18
@cla-checker-service

cla-checker-service Bot commented Jun 30, 2026

Copy link
Copy Markdown

❌ Author of the following commits did not sign a Contributor Agreement:
1260761

Please, read and sign the above mentioned agreement if you want to contribute to this project

…peline

The asset ingest pipeline converted `json.ratings.acr.score` and
`json.ratings.aes.score` to `long` with a `convert` processor. Tenable
Vulnerability Management can emit these scores as decimal strings (e.g.
"9.0" / "744.0"). `convert` to `long` runs `Long.parseLong`, which throws
`NumberFormatException: For input string: "9.0"` on any decimal form,
appends to `error.message`, and tags the document `pipeline_error`.

Replace the two `convert` processors with `script` processors that parse
the value as a long, falling back to `Double.parseDouble` and truncating
when the string carries a fractional part, mirroring the existing handling
for the flat `acr_score` / `exposure_score` fields. Numeric inputs are
also coerced, so integer and double JSON values continue to work.

Update the asset pipeline test so the `ratings` record sends the scores as
decimal strings, reproducing the failure and proving the fix.
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Reviewers

Buildkite won't run for external contributors automatically; you need to add a comment:

  • /test : will kick off a build in Buildkite.

NOTE: https://github.com/elastic/integrations/blob/main/.buildkite/pull-requests.json contains all those details.

@Jsmith-DigitalRealty Jsmith-DigitalRealty force-pushed the fix/tenable_io-ratings-score-decimal-string branch from 6e196d3 to 1260761 Compare June 30, 2026 14:19
@Jsmith-DigitalRealty Jsmith-DigitalRealty deleted the fix/tenable_io-ratings-score-decimal-string branch June 30, 2026 14:24
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

Successfully merging this pull request may close these issues.

1 participant