-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(loggly): support http/s bulk sending for batch logs #6212
Conversation
apisix/plugins/loggly.lua
Outdated
@@ -232,13 +233,71 @@ local function send_data_over_udp(message) | |||
end | |||
|
|||
|
|||
local function send_bulk_over_http(message, metadata, conf) | |||
local endpoint = path.join(metadata.value.host, "bulk", conf.customer_token, "tag", "bulk") | |||
local has_prefix = metadata.value.host:find("http") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use
Line 46 in 615ee41
function _M.has_prefix(s, prefix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Thanks for the suggestion.
Updated.
apisix/plugins/loggly.lua
Outdated
if not body then | ||
return false, "failed to send log to loggly, http status code: " .. res.status | ||
else | ||
return false, "failed to send log to loggly, " .. res.body |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also print the status code here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Sounds good to me. Thanks!
What this PR does / why we need it:
#6112 [Phase -2 Part 1]
Pre-submission checklist: