-
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
Feature Request - Adding Logged filename to the metadata #8226
Comments
If you're using I've used this in the past to then easily use it to simplify filters in Grafana for example: https://www.couchbase.com/blog/fluent-bit-tips-tricks-log-forwarding-couchbase/#aliases I think in your case, the issue is that ES output does not support record-accessor syntax for the index but Opensearch does. However there is a PR open I believe to add this. Then you could just look up the index from a key and you can set that key however you like (e.g. a custom filter or just the EDIT: |
The key value in having the input include the file name is how to know which file was the source of the log event when the input path has wildcards in it. having the path would allow the pipeline to extract context from it. For example if my J2EE app server has multiple apps logging to a common logging location in the file system. I either need to have a tail defined for each app - and use the tag to derive context - messy and error prone if we forget the config needing to be added to Fluent Bit. Or we have Fluent Bit use a wildcard in the path, and then with the full file path add a filter take the name/infer the app from the source file |
Yeah so the |
I am also trying to grasp how to reference the filename in the output, especially based on the path.
Assuming I want to dynamically generate indices in the Elasticsearch output based on the filenames (e.g., mylog1.log, mylog2.log), how would I reference the filename in the output configuration?
I used ${?filename_variable} as a placeholder since I'm not sure about the actual syntax. Additionally, I'm not certain I fully understood the solution provided below. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the |
This issue was closed because it has been stalled for 5 days with no activity. |
Is your feature request related to a problem? Please describe.
I'm currently working on a logging setup where my Kubernetes cluster, running on AWS EKS, generates logs across approximately 20 files. The challenge I'm encountering revolves around the static nature of the Fluent Bit configuration. Each new log file necessitates a manual addition of output/input configurations, and this has become a bit cumbersome as the number of files grows.
Describe the solution you'd like
Describe alternatives you've considered
I'm envisioning a feature that introduces dynamic index routing based on the filename. Ideally, a syntax akin to
${@metadata__filename}
could be incorporated into the Elasticsearch output plugin configuration. This would allow Fluent Bit to dynamically generate indices based on the source filename, providing a seamless solution for ingesting logs from multiple files without the need for constant manual intervention.A sample configuration might look like this:
Additional context
I understand that feature development involves careful consideration, and I appreciate your time and efforts in evaluating this request. Your continuous dedication to refining Fluent Bit is truly commendable.
Thank you for your attention, and I look forward to any insights.
The text was updated successfully, but these errors were encountered: