Dynamically create output folder for each module logs using deployment name in fluentBit #7107
Unanswered
raghibomar786
asked this question in
Q&A
Replies: 1 comment 2 replies
-
@patrick-stephens , you mentioned: This creates a separate output file named after the tag for each service but does not create subfolders for each deployment-name. And since new tag can only contain a-z,A-Z, 0-9 and .-, (ref), I cannot put a '/' in my tag that may create a subdirectory. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've several modules deployed in my kubernetes cluster and I use fluentBit to read logs for all modules from /var/log/containers folder and write them to a file on a persistent volume. I'm able to successfully write all log files to a single folder in my output path. Now, I want to write the logs of each module in a separate subfolder in my output path named as deployment/release name of each module. The log file is named in the following format pod-name_namespace-name_deployment-name (i.e, each of the name is separated by an underscore _). How do I extract this information from my log file name and use it in the output path in FluentBit configuration?
My current configuration looks like this:
And this makes my tag value of the form kube.var.log.containers.pod-name_namespace-name_chart-name, I want to do something like:
What is the correct way of doing this? From the documentation it seems like Tag_Regex can be used for doing this but how it can be used is not very clear.
Beta Was this translation helpful? Give feedback.
All reactions