0

Is it possible to run the regex preprocessor over multiple measurements like that?

[[processors.regex]]
  namepass = ["measure1", "measure2"]

[[processors.regex.fields]]
    key = "agent"
    pattern = '^.*$'
    replacement = "NORMAL"
    result_key = "agent_type"

In my case two measurements both have an Access-Log as source ([[inputs.tail]]) but I want to keep them seperate as I want to compare both eventually.

Erando
  • 811
  • 3
  • 13
  • 27

1 Answers1

0

To answer my own question: I'm not sure if this is how it's meant to be but a quickfix would looke like that:

[[processors.regex]]
  namepass = ["measure1"]

[[processors.regex.fields]]
    key = "agent"
    pattern = '^.*$'
    replacement = "NORMAL"
    result_key = "agent_type"

[[processors.regex]]
  namepass = ["measure2"]

[[processors.regex.fields]]
    key = "agent"
    pattern = '^.*$'
    replacement = "NORMAL"
    result_key = "agent_type"

Unfortunately it contains duplicated code which is bad.

Erando
  • 811
  • 3
  • 13
  • 27
  • I'm curious to know why you did this way. The configuration you mentioned in the question would have worked fine. – robert Sep 19 '20 at 15:43
  • Well obviously it didn't work out for me which is why I had to use this dirty quickfix. I wonder why the first config didn't work too. – Erando Sep 21 '20 at 11:22