← Back to Pull requests

[YAML] Add SplunkIO write SchemaTransform and WriteToSplunk #40481

Closed
unknown closed this pull request without merging on Oct 28, 2026 15:54 UTC
View on GitHub
unknown unknown commented on Oct 09, 2026 09:45 UTC
Author

Adds a SchemaTransform for SplunkIO writes and exposes it in Beam YAML as WriteToSplunk. It follows the same approach as the Datadog one (#38362). SplunkIO in Java only supports writes, so there is no ReadFromSplunk here.

Each input row becomes a SplunkEvent. event (string) is required. time (int64), host, source, sourcetype, index and fields are optional. fields can be a nested row or a JSON object string, and other columns are ignored. The config covers everything SplunkIO.Write supports (url, token, batch_count, parallelism, disable_certificate_validation, root_ca_certificate_path, enable_batch_logs, enable_gzip_http_compression) plus error_handling. The error output has the same shape as Datadog's: rows that can't be converted come back with failed_row and a 400, and HEC write failures come back with the HTTP status and the payload. Without error_handling, a failed write fails the pipeline.

While testing this I found that SplunkWriteError loses all of its values once it goes through a coder. It has @DefaultSchema(AutoValueSchema.class), but its accessors aren't get-prefixed, so the inferred schema has no fields and every error decodes as null/null/null. SplunkEventWriterTest doesn't catch this because containsInAnyOrder decodes both sides with the same coder. I replaced the annotation with a hand-written SplunkWriteErrorSchemaProvider, so SplunkWriteError is still encoded as a row, now with statusCode, statusMessage and payload fields. This changes the output coder of SplunkIO.Write, so I listed it under bugfixes in CHANGES.md.

The YAML test runs SplunkIO on the Python FnApiRunner, which failed on the stateful writer's timers: the runner length prefixes coders it doesn't know for PCollections but not for timer family coders, so it tried to decode the Java VarIntCoder keys itself. The runner now length prefixes timer coders the same way. This also makes the beam:coders:javasdk:0.1 registration in integration_tests.py unnecessary, so that's removed.

Changes:

  • SplunkWriteSchemaTransformProvider / SplunkWriteSchemaTransformConfiguration, registered in the IO expansion service

  • WriteToSplunk in standard_io.yaml and the matching entry in standard_external_transforms.yaml

  • SplunkWriteErrorSchemaProvider, used as the default schema of SplunkWriteError and for the fields of the error output

  • FnApiRunner length prefixes timer family coders (translations.py)

  • Java tests against a mock HEC server, a YAML integration test with a fake HEC fixture (tests/splunk.yaml), and a translations test for the timer coders
  • Fixes #40470

    Diff: 328 lines (+246 / -82) across 4 files Reviewer: schizophrenicmaniac Review duration: 27728m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 328 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.347
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #40481"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.1% (MEDIUM) · Higher = larger blast radius
    42.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.6% · Safe to merge
    16.6%
    Repository