Hi,
I am finding difficult to create the scrape config that can create labels “sec,min,hr,month,year”.I am using the helm chart grafana/promtail and trying to add some code in the extraScrapeConfigs.
below is the code we have implemented in instances and now we are looking to use in K8.
scrape_configs:
- job_name: logs
pipeline_stages:
#- timestamp:
# source: time
# format: RFC3339
- regex:
expression: ^(?P<timestamp>\[[^\]]*])
- regex:
expression: (?P<year>\d{4})-(?P<month>\d{2})-(?P<date>\d{2})\ (?P<hour>\d{2})
source: “timestamp”
- labels:
year:
month:
date:
hour:
Please suggest any modifications we may do in the above code to create “sec,min,hr,month,year” labels.
Thanks in Advance.