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

Loading…
Cancel
Save