OK, I’m trying to convert some JSON log fields into Labels but i must be doing something terribly wrong. Here’s what I have:
scrape_configs:
- job_name: kubernetes-pods
kubernetes_sd_configs:
- role: pod
pipeline_stages:
- cri:
- match:
selector: '{k8s_namespace_name=~"traefik"}'
stages:
- json:
expressions:
ClientHost: ClientHost
RequestHost: RequestHost
RequestMethod: RequestMethod
RequestPath: RequestPath
RequestScheme: RequestScheme
request_User-Agent: UserAgent
labels:
ClientHost:
RequestHost:
RequestMethod:
RequestPath:
RequestScheme:
UserAgent:
I never get the labels on the “traefik” logs. I also tried with “__meta_kubernetes_namespace” label instead of k8s_namespace_name (that get’s created on the relabel_configs section.
What am I doing wronghere? 