You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/09/07 16:06:11 UTC

[GitHub] [kafka] daehokimm opened a new pull request #9259: KAFKA-10466: Allow regex for MaskField SMT to replacement

daehokimm opened a new pull request #9259:
URL: https://github.com/apache/kafka/pull/9259


   *Requires KIP - do not merge*
   
   ### Goal
   
   Allow regex for MaskField SMT to replacement
   
   ### Details
   
   The existing `org.apache.kafka.connect.transforms.MaskField` SMT allow to masking with literal replacement. This PR introduces addtional config param `regex`, which will be applied to match for replacement.
   
   example config :
   
   ```
   transforms=IPMask
   transforms.IPMask.type=org.apache.kafka.connect.transforms.MaskField$Value
   transforms.IPMask.fields=ipAddress
   transforms.IPMask.replacement=$1.$2.xxx.xxx
   transforms.IPMask.regex=(\\d*)\\.(\\d*)\\.\\d*\\.\\d*
   ```
   
   example input & output : 
   
   ```
   # input 
   {    "no" : 1, "name" : "who", "ipAddress" : "123.45.67.89" }
   
   # output
   {    "no" : 1, "name" : "who", "ipAddress" : "123.45.***.***" }
   ```
   
   ### Restrictions :
   
   * only string values ar supported
   * regex is ignored when `replacement` is not set up.
   
   if `regex` config is set without `replacement` config, the `regex` config is ignored. and then field value will be replaced with null value.
   
   ```
   transforms=RegexMask
   transforms.RegexMask.type=org.apache.kafka.connect.transforms.MaskField$Value
   transforms.RegexMask.fields=message
   transforms.RegexMask.regex=^.*
   ```
   
   ### Testing 
   
   * Unit tests are provided.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] aith commented on pull request #9259: KAFKA-10466: Allow regex for MaskField SMT to replacement

Posted by GitBox <gi...@apache.org>.
aith commented on pull request #9259:
URL: https://github.com/apache/kafka/pull/9259#issuecomment-1009619745


   Hey @daehokimm, I'm thinking that the maintainers would be more inclined to review your PR if the build errors were resolved. I went ahead and fixed the build errors at my [branch here](https://github.com/aith/kafka/tree/10466)- pull from it if you have time. If not, I can push the changes (I just need push permissions to your branch).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] daehokimm commented on pull request #9259: KAFKA-10466: Allow regex for MaskField SMT to replacement

Posted by GitBox <gi...@apache.org>.
daehokimm commented on pull request #9259:
URL: https://github.com/apache/kafka/pull/9259#issuecomment-827442242


   please review this :) 🙏 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org