loggie-io / loggie

A lightweight, cloud-native data transfer agent and aggregator
https://loggie-io.github.io/docs-en/
Apache License 2.0
1.26k stars 167 forks source link

Support transformer replace action #630

Closed dongjiang1989 closed 1 year ago

dongjiang1989 commented 1 year ago

/area interceptor

Describe the feature

support replace action. like: strings.Replace(...)

like: https://grafana.com/docs/loki/latest/clients/promtail/stages/replace/

interceptors:
  - type: transformer
    actions:
      - action: replace(body)
        old: "abc"
        new: "ABC"
      ...

input:

{
  "body": "2023-09-04T09:21:20.545525544Z DEBUG abc"
}

output:

{
  "body": "2023-09-04T09:21:20.545525544Z DEBUG ABC"
}