formating and text fixes, adjust regexp

pull/2094/head
Matti Savolainen 8 years ago
parent 56907ba6e3
commit f867c1fd58

@ -31,7 +31,7 @@ var (
patFileSDName = regexp.MustCompile(`^[^*]*(\*[^/]*)?\.(json|yml|yaml|JSON|YML|YAML)$`) patFileSDName = regexp.MustCompile(`^[^*]*(\*[^/]*)?\.(json|yml|yaml|JSON|YML|YAML)$`)
patRulePath = regexp.MustCompile(`^[^*]*(\*[^/]*)?$`) patRulePath = regexp.MustCompile(`^[^*]*(\*[^/]*)?$`)
patAuthLine = regexp.MustCompile(`((?:password|bearer_token|secret_key|client_secret):\s+)(".+"|'.+'|[^\s]+)`) patAuthLine = regexp.MustCompile(`((?:password|bearer_token|secret_key|client_secret):\s+)(".+"|'.+'|[^\s]+)`)
relabelTarget = regexp.MustCompile(`^(?:(?:[a-zA-Z_]|\$\{?[\w]+\}?)+\w*)+$`) relabelTarget = regexp.MustCompile(`^(?:(?:[a-zA-Z_]|\$(?:\{\w+\}|\w+))+\w*)+$`)
) )
// Load parses the YAML input s into a Config. // Load parses the YAML input s into a Config.
@ -987,8 +987,8 @@ type RelabelConfig struct {
Regex Regexp `yaml:"regex,omitempty"` Regex Regexp `yaml:"regex,omitempty"`
// Modulus to take of the hash of concatenated values from the source labels. // Modulus to take of the hash of concatenated values from the source labels.
Modulus uint64 `yaml:"modulus,omitempty"` Modulus uint64 `yaml:"modulus,omitempty"`
// The label to which the resulting string is written in a replacement. // TargetLabel is the label to which the resulting string is written in a replacement.
// regex interpolation is allowed for the replace action. // Regexp interpolation is allowed for the replace action.
TargetLabel string `yaml:"target_label,omitempty"` TargetLabel string `yaml:"target_label,omitempty"`
// Replacement is the regex replacement pattern to be used. // Replacement is the regex replacement pattern to be used.
Replacement string `yaml:"replacement,omitempty"` Replacement string `yaml:"replacement,omitempty"`

@ -106,7 +106,7 @@ scrape_configs:
relabel_configs: relabel_configs:
- source_labels: [__meta_sd_consul_tags] - source_labels: [__meta_sd_consul_tags]
separator: ',' separator: ','
regex: label:([^=]+)=([^,]+) regex: label:([^=]+)=([^,]+)
target_label: ${1} target_label: ${1}
replacement: ${2} replacement: ${2}

Loading…
Cancel
Save