Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^([^;,\n]*);.*(\b\1\b=|;)(https?)(,.*)?$
/
gm

Description

relabel_configs:
  # allow override of http scheme, both of the following annotations are supported:
  #   prometheus.io/scheme: http
  #   metrics.agent.grafana.com/scheme: http
  #   or 
  #   prometheus.io/scheme: http-metrics=http,http-service=https
  #   metrics.agent.grafana.com/scheme: http-metrics=http,http-service=https
  - action: replace
    source_labels:
      - __meta_kubernetes_service_port_name
      - __meta_kubernetes_service_annotation_prometheus_scheme
      - __meta_kubernetes_service_annotation_metrics_agent_grafana_com_scheme
Submitted by AaronB - 2 years ago