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

feat: Add transformer replace action #631

Closed dongjiang1989 closed 1 year ago

dongjiang1989 commented 1 year ago

Proposed Changes:

Which issue(s) this PR fixes:

Fixes #630

Additional documentation:

interceptors:
  - type: transformer
    actions:
      - action: replace(body)
        old: "3"
        new: "W"
      ...

input:

{
     "body": "2023/09/05 12:32:01 error zap.go:66: 192.168.0.1 54Ce5d87-b94C-C40a-74a7-9cd375289334"
}

output:

{
     "body": "202W/09/05 12:W2:01 error zap.go:66: 192.168.0.1 54ce5d87-b94c-c40a-74a7-9cdW75289WW4",
}
dongjiang1989 commented 1 year ago

/cc @ethfoo