You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/04/27 04:17:00 UTC

[GitHub] [incubator-apisix] cyxinda opened a new issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

cyxinda opened a new issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512


   ### Issue description
   There are three point,as follow:
   1. 
   I hope the kafka-logger plugin would write the request body and the response body to kafka additionally.
   
   2.
   I hope the kafka-logger plugin can add the filter features ,so that we can only record the necessary url .
   
   3. 
   These two functions should be optional by setting parameters.
   
   Looking forward to your reply ,Thanks.
   
   ### Environment
   
   * apisix version (cmd: `apisix version`):
   * OS:
   


----------------------------------------------------------------
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] [incubator-apisix] sshniro commented on issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

Posted by GitBox <gi...@apache.org>.
sshniro commented on issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620474349


   I assume we can implement this filtering login in the [Log Util](https://github.com/apache/incubator-apisix/blob/0f3310562c1a117f9519b8b022c6ede282cf670b/apisix/utils/log-util.lua#L21) itself. Therefore, all the loggers can have this filtering logic enabled by default.
   
   How about this format?
   ```bash
   curl http://127.0.0.1:9080/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "username": "foo",
       "plugins": {
          "kafka-logger": {
              "broker_list" :
                {
                  "127.0.0.1":9092
                },
              "kafka_topic" : "test2",
              "key" : "key1",
              "log_filter":{
                 response_body: true,
                 request_body: true
              }
          }
       },
       "upstream": {
          "nodes": {
              "127.0.0.1:1980": 1
          },
          "type": "roundrobin"
       },
       "uri": "/hello"
   }'
   ```
   
   By default request and response, body is disabled.


----------------------------------------------------------------
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] [incubator-apisix] sshniro edited a comment on issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

Posted by GitBox <gi...@apache.org>.
sshniro edited a comment on issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620517356


   > `2. I hope the kafka-logger plugin can add the filter features ,so that we can only record the necessary url .`
   > This means that I can filter out some URLs that I don't care about at all, such as CSS, JS, picture, etc.
   
   Then we need to include a regex in log until and send nil results if it does not satisfy the URL.
   
   


----------------------------------------------------------------
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] [incubator-apisix] sshniro edited a comment on issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

Posted by GitBox <gi...@apache.org>.
sshniro edited a comment on issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620474349


   I assume we can implement this filtering logic in the [Log Util](https://github.com/apache/incubator-apisix/blob/0f3310562c1a117f9519b8b022c6ede282cf670b/apisix/utils/log-util.lua#L21) itself. Therefore, all the loggers can have this filtering logic enabled by default.
   
   How about this format?
   ```bash
   curl http://127.0.0.1:9080/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "username": "foo",
       "plugins": {
          "kafka-logger": {
              "broker_list" :
                {
                  "127.0.0.1":9092
                },
              "kafka_topic" : "test2",
              "key" : "key1",
              "log_filter":{
                 response_body: true,
                 request_body: true
              }
          }
       }
   }'
   ```
   
   By default request and response, body is disabled.
   If agreed then I can implement the filtering logic in the logutil.


----------------------------------------------------------------
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] [incubator-apisix] moonming commented on issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620466689


   @sshniro what do you think?


----------------------------------------------------------------
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] [incubator-apisix] sshniro commented on issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

Posted by GitBox <gi...@apache.org>.
sshniro commented on issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620517356


   > `2. I hope the kafka-logger plugin can add the filter features ,so that we can only record the necessary url .`
   > This means that I can filter out some URLs that I don't care about at all, such as CSS, JS, picture, etc.
   
   Then we need to include a regex in log until and send nil results of it does not satisfy the URL.
   
   


----------------------------------------------------------------
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] [incubator-apisix] moonming commented on issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620510643


   you can enable kafka plugin in some routes, besides static files.
   one more think, why you deal with css, js files with API gateway?
   
   月夜枫 <no...@github.com> 于 2020年4月28日周二 下午5:53写道:
   
   > 2. I hope the kafka-logger plugin can add the filter features ,so that we
   > can only record the necessary url .
   > This means that I can filter out some URLs that I don't care about at all,
   > such as CSS, JS, picture, etc.
   >
   > —
   > You are receiving this because you commented.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620502750>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AGJZBK7DKDWCJOHCSMZZRH3RO2RS7ANCNFSM4MRSHW7A>
   > .
   >
   


----------------------------------------------------------------
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] [incubator-apisix] sshniro edited a comment on issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

Posted by GitBox <gi...@apache.org>.
sshniro edited a comment on issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620474349


   I assume we can implement this filtering logic in the [Log Util](https://github.com/apache/incubator-apisix/blob/0f3310562c1a117f9519b8b022c6ede282cf670b/apisix/utils/log-util.lua#L21) itself. Therefore, all the loggers can have this filtering logic enabled by default.
   
   How about this format?
   ```bash
   curl http://127.0.0.1:9080/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "username": "foo",
       "plugins": {
          "kafka-logger": {
              "broker_list" :
                {
                  "127.0.0.1":9092
                },
              "kafka_topic" : "test2",
              "key" : "key1",
              "log_filter":{
                 response_body: true,
                 request_body: true
              }
          }
       }
   }'
   ```
   
   By default request and response, body is disabled.


----------------------------------------------------------------
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] [incubator-apisix] sshniro edited a comment on issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

Posted by GitBox <gi...@apache.org>.
sshniro edited a comment on issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620474349


   I assume we can implement this filtering login in the [Log Util](https://github.com/apache/incubator-apisix/blob/0f3310562c1a117f9519b8b022c6ede282cf670b/apisix/utils/log-util.lua#L21) itself. Therefore, all the loggers can have this filtering logic enabled by default.
   
   How about this format?
   ```bash
   curl http://127.0.0.1:9080/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "username": "foo",
       "plugins": {
          "kafka-logger": {
              "broker_list" :
                {
                  "127.0.0.1":9092
                },
              "kafka_topic" : "test2",
              "key" : "key1",
              "log_filter":{
                 response_body: true,
                 request_body: true
              }
          }
       }
   }'
   ```
   
   By default request and response, body is disabled.


----------------------------------------------------------------
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] [incubator-apisix] cyxinda commented on issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

Posted by GitBox <gi...@apache.org>.
cyxinda commented on issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620516251


   > you can enable kafka plugin in some routes, besides static files. one more think, why you deal with css, js files with API gateway? 月夜枫 <no...@github.com> 于 2020年4月28日周二 下午5:53写道:
   > […](#)
   > 2. I hope the kafka-logger plugin can add the filter features ,so that we can only record the necessary url . This means that I can filter out some URLs that I don't care about at all, such as CSS, JS, picture, etc. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <[#1512 (comment)](https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620502750)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGJZBK7DKDWCJOHCSMZZRH3RO2RS7ANCNFSM4MRSHW7A> .
   
   
   
   Sometimes, I need to proxy some web services with apisix, and the route contains wildcards. It naturally contains some resource files, such as CSS, JS, pictures, etc.
   


----------------------------------------------------------------
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] [incubator-apisix] cyxinda commented on issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

Posted by GitBox <gi...@apache.org>.
cyxinda commented on issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512#issuecomment-620502750


   `2.
   I hope the kafka-logger plugin can add the filter features ,so that we can only record the necessary url .`
   This means that I can filter out some URLs that I don't care about at all, such as CSS, JS, picture, etc.


----------------------------------------------------------------
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] [incubator-apisix] membphis closed issue #1512: request help: should the plugin of kafka-logger add filter options and the body in request and response?

Posted by GitBox <gi...@apache.org>.
membphis closed issue #1512:
URL: https://github.com/apache/incubator-apisix/issues/1512


   


----------------------------------------------------------------
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