Skip to content
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

help request: syslog plugin / attribute 'name' confusion #10474

Closed
Wasta-Geek opened this issue Nov 10, 2023 · 3 comments
Closed

help request: syslog plugin / attribute 'name' confusion #10474

Wasta-Geek opened this issue Nov 10, 2023 · 3 comments
Assignees

Comments

@Wasta-Geek
Copy link

Description

Hi

I'm kind of new to Apisix but I wanted to use the syslog plugin and I had trouble to understand the meaning of the plugin key 'name'.
My original need was to modify what would correspond to the 'tag' part (apisix[pid]) in the syslog message and I thought it would correspond to the plugin attribute 'name'.

But this attribute seems to be ignored as I couldn't find it in my remote logs. (other plugin attributes would get applied correctly so it seems not to be a config problem on my side)
I tried to see it via a tcpdump what's been received and I couldn't retrieves the value anywhere, I also tried to grep 'name' in the LUA syslog plugin files and I couldn't see a reference to this.

So I wanted to know what is the usage / impact of this attribute regarding the syslog plugin ?

Thanks for your help, best regards.

Environment

  • APISIX version (run apisix version): 3.6.0
  • Operating system (run uname -a):Linux 5.10.0-25-amd64 change: added doc of how to load plugin. #1 SMP Debian 5.10.191-1 (2023-08-16) x86_64 GNU/Linux
  • OpenResty / Nginx version (run openresty -V or nginx -V): nginx/1.18.0
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@kayx23
Copy link
Member

kayx23 commented Nov 11, 2023

APISIX loggers send logs in batches. The name here is the ID of the batch processor for the plugin, which conveniently inherits the plugin's name.

However I noticed the value is hardcoded in, which means what you configure actually doesn't matter. I opened a PR to removed the name from attributes for kafka-logger here: #10476

If I'm not wrong on this, we should remove name attribute from the doc for all loggers that hard code the value in.

For sys log specifically, the value is hard coded here:

local batch_processor_manager = bp_manager_mod.new("sys logger")

You won't see this value in the actual logs.

@Wasta-Geek
Copy link
Author

Oh okk, I didn't see that the name in the documentation was similar as in this line and thus meant it would correspond to the batch processing part (even if ignored) 👍

Thanks for your help / time, have a nice day !

@kayx23 kayx23 self-assigned this Nov 14, 2023
@kayx23
Copy link
Member

kayx23 commented Nov 14, 2023

Just FYI, if you export metrics to prometheus, you should be able to see the names for batch processors as such

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants