Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[BUG] splunk: export parsing, job polling and missing values are not handled robustly

Abierto
#897 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@AnKiT-GaRG2 ya está trabajando en esto.

Desde el 27/10/2026.

  • #898 de @AnKiT-GaRG2 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
typescript
Área
data

Línea de trabajo

Start in splunk/src/model/splunk-client.ts at exportSearch and convertResultsToTimeSeries, then read the polling loops in get-splunk-time-series-data.ts and get-splunk-log-data.ts. Reproduce the export failure with a mocked response containing a line without result, then make parse errors name the Splunk export response. Done means malformed job status throws, missing metric values become null, and tests cover each case; note that linked PR #898 already exists, so check it before starting.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

A few robustness problems in the Splunk plugin make queries fail with an unhelpful error, or draw wrong data, instead of surfacing the real cause.

1. exportSearch assumes every response line carries a result

splunk/src/model/splunk-client.ts (exportSearch):

const lines = text.trim().split('\n');
const results = lines.filter((line: string) => line.trim()).map((line: string) => JSON.parse(line).result);
  • A line without a result key (for example a messages line) puts undefined into results.
  • convertResultsToTimeSeries then reads result._time on that entry and throws a TypeError, so the panel fails with an error that says nothing about Splunk.
  • A line that is not valid JSON throws a bare SyntaxError with no context.

I have not reproduced this against a live Splunk. The failure is reproducible with a mocked export response that contains a line without result.

2. A malformed job status ends polling early

In get-splunk-time-series-data.ts and get-splunk-log-data.ts, if getJobStatus returns a malformed response the loop only logs a warning and breaks, and getJobResults is then called for a job that may not be finished. That returns partial or empty results without any error.

3. Missing values become 0 in time series

convertResultsToTimeSeries uses Number(result[metricKey]) || 0. A missing or non-numeric value is plotted as 0, which draws a false data point. null (a gap) would be more accurate.

Proposed fix
  • Skip lines without a result in exportSearch, and wrap parse errors in an error that names the Splunk export response.
  • Throw a descriptive error when the job status is malformed.
  • Map missing or non-numeric values to null instead of 0.
  • Add tests for each.

I'm happy to send a PR for this.

Lenguaje dominante
TypeScript
Estrellas
33
Forks
91
Merge medio
1 d 17 h
PR fusionados (30 d)
37

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de perses/plugins

Todos los issues de perses/plugins

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.