Re: [PR] feat: implement datastream support on elasticsearch-logger plugin [apisix]

2026-05-31 Thread via GitHub


github-actions[bot] commented on PR #13102:
URL: https://github.com/apache/apisix/pull/13102#issuecomment-4586445341

   This pull request has been marked as stale due to 60 days of inactivity. It 
will be closed in 4 weeks if no further activity occurs. If you think that's 
incorrect or this pull request should instead be reviewed, please simply write 
any comment. Even if closed, you can still revive the PR at any time or discuss 
it on the [email protected] list. Thank you for your contributions.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] feat: implement datastream support on elasticsearch-logger plugin [apisix]

2026-03-31 Thread via GitHub


Baoyuantop commented on PR #13102:
URL: https://github.com/apache/apisix/pull/13102#issuecomment-4167191089

   Hi @jr-instantsystem, please fix the failed CI


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] feat: implement datastream support on elasticsearch-logger plugin [apisix]

2026-03-19 Thread via GitHub


jr-instantsystem commented on code in PR #13102:
URL: https://github.com/apache/apisix/pull/13102#discussion_r2958687618


##
apisix/plugins/elasticsearch-logger.lua:
##
@@ -202,11 +206,21 @@ end
 
 local function get_logger_entry(conf, ctx)
 local entry = log_util.get_log_entry(plugin_name, conf, ctx)
-local body = {
-index = {
-_index = conf.field.index
+local body
+if conf.field.index then
+body = {
+index = {
+_index = conf.field.index
+}
 }
-}
+elseif conf.field.datastream then
+body = {
+create = {
+_index = conf.field.datastream
+}
+}
+end
+
 -- for older version type is required
 if conf._version == "6" or conf._version == "5" then
 body.index._type = "_doc"

Review Comment:
   ho, right... fix pushed
   datastreams are available for ES 7+ only



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] feat: implement datastream support on elasticsearch-logger plugin [apisix]

2026-03-19 Thread via GitHub


jr-instantsystem commented on code in PR #13102:
URL: https://github.com/apache/apisix/pull/13102#discussion_r2958687618


##
apisix/plugins/elasticsearch-logger.lua:
##
@@ -202,11 +206,21 @@ end
 
 local function get_logger_entry(conf, ctx)
 local entry = log_util.get_log_entry(plugin_name, conf, ctx)
-local body = {
-index = {
-_index = conf.field.index
+local body
+if conf.field.index then
+body = {
+index = {
+_index = conf.field.index
+}
 }
-}
+elseif conf.field.datastream then
+body = {
+create = {
+_index = conf.field.datastream
+}
+}
+end
+
 -- for older version type is required
 if conf._version == "6" or conf._version == "5" then
 body.index._type = "_doc"

Review Comment:
   ho, right... fix pushed



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] feat: implement datastream support on elasticsearch-logger plugin [apisix]

2026-03-19 Thread via GitHub


Baoyuantop commented on code in PR #13102:
URL: https://github.com/apache/apisix/pull/13102#discussion_r2958583788


##
apisix/plugins/elasticsearch-logger.lua:
##
@@ -202,11 +206,21 @@ end
 
 local function get_logger_entry(conf, ctx)
 local entry = log_util.get_log_entry(plugin_name, conf, ctx)
-local body = {
-index = {
-_index = conf.field.index
+local body
+if conf.field.index then
+body = {
+index = {
+_index = conf.field.index
+}
 }
-}
+elseif conf.field.datastream then
+body = {
+create = {
+_index = conf.field.datastream
+}
+}
+end
+
 -- for older version type is required
 if conf._version == "6" or conf._version == "5" then
 body.index._type = "_doc"

Review Comment:
   When datastream is configured, the body only contains the "create" key, not 
the "index" key. For version compatibility, accessing `nil.index` with 
`body.index._type = "_doc"` will trigger a runtime error: "attempt to index a 
nil value".



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]