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

[interceptor/transformer] feat:support setFloat/setInt/setBool #620

Closed zhu733756 closed 1 year ago

zhu733756 commented 1 year ago

Proposed Changes:

Which issue(s) this PR fixes:

Fixes #621

Additional documentation:

interceptor: support setFloat/setInt/setBool

1. an older configuration is:
  - type: transformer
    name: setEmpty
    actions:
    - if: NOT exist(count)
      then:
        - action: set(count, 0)
        - action: strconv(count, float)
        - action: return()
      else:
        - action: return()

2. the newly configuration is: 
  - type: transformer
    name: setEmpty
    actions:
    - if: NOT exist(count)
      then:
        - action: setFloat(count, 0)
        - action: return()
      else:
        - action: return()
zhu733756 commented 1 year ago

/cc @ethfoo