-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
out_es: Allow Logstash_Prefix_Key with prefix #8902
base: master
Are you sure you want to change the base?
Conversation
The option Logstash_Prefix_Key should be a record accessor. There is a convenience feature that automatically prefixes a $ when the value is just a static string (since that is expected to be set as Logstash_Prefix instead). However, record accessor can contain the $ not just at the beginning. One example would be containers-$kubernetes['namespace_name'] This patch thus makes the autodetection look for a $ in the whole value, not just the first character. Signed-off-by: Jan-Philipp Litza <[email protected]>
I've tested this against a container with the elasticsearch image.
While the following config shows the new behavior of allowing a static prefix and writing to the index "namespace-prod":
The latter produced the following debug output under valgrind:
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Well yes, dear bot, there hasn't been any activity for over half a year. But what can I do about that? @edsiper Maybe you can find the time to review this 1-line-patch? |
The option Logstash_Prefix_Key should be a record accessor.
There is a convenience feature that automatically prefixes a $ when the value is just a static string (since that is expected to be set as Logstash_Prefix instead).
However, record accessor can contain the $ not just at the beginning. One example would be
containers-$kubernetes['namespace_name']
This patch thus makes the autodetection look for a $ in the whole value, not just the first character.
Fixes #8773
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.