Fix json stage fields in example (#7654)

**What this PR does / why we need it**:
Fix the json section of a scrape config used in a unit test. The unit
test doesn't fail as the unmarshaling is very generic. The json stage is
unit tested in a different place.
This was mentioned as a comment on another PR:
https://github.com/grafana/loki/pull/7653.

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
pull/8111/head
Michel Hollands 2 years ago committed by GitHub
parent fb1ebcb01b
commit ff57f7249c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      clients/pkg/promtail/scrapeconfig/scrapeconfig_test.go

@ -30,14 +30,15 @@ pipeline_stages:
- regex: - regex:
expr: "./*" expr: "./*"
- json: - json:
timestamp: expressions:
source: time timestamp:
format: RFC3339 source: time
labels: format: RFC3339
stream: labels:
source: json_key_name.json_sub_key_name stream:
output: source: json_key_name.json_sub_key_name
source: log output:
source: log
job_name: kubernetes-pods-name job_name: kubernetes-pods-name
kubernetes_sd_configs: kubernetes_sd_configs:
- role: pod - role: pod
@ -138,4 +139,6 @@ func TestLoadConfig(t *testing.T) {
if err != nil { if err != nil {
panic(err) panic(err)
} }
require.NotZero(t, len(config.PipelineStages))
} }

Loading…
Cancel
Save