Comments (7)
@cw-sakamoto
I've implemented the add_labels
feature described earlier. You can give it a try with this image jvassev/kube-fluentd-operator:v1.6.0-17-gbdc4593
. It's built from bdc4593.
Just put add_labels sub-component=compXXX
to your mounted_file
s and then you can distinguish between different log files from the same container.
from kube-fluentd-operator.
Hi,
In general kube-fluentd-operator tries to step away from the fluentd tag. Instead, it promotes Kubernetes labels.
In your case however all the logevents come from a single pod meaning they share the same labels. So what can be done here is let users attach new labels to the @type mounted-file
logs ike this:
<source>
@type mounted-file
path /var/log/hello1.log
labels msg=hello
add_labels app=app1
tag hello1-log
</source>
<source>
@type mounted-file
path /var/log/hello2.log
labels msg=hello
add_labels app=app2
tag hello2-log
</source>
Then you use the $labels macro to select the logs:
<match $labels(app=app1)>
@type test123
</match>
<match $labels(app=app2)>
@type test456
</match>
Indeed, this would be easy to add - do you think this would help you in your setup?.
However, it would be more "kubernetes-idiomatic" to spread those processes producing different log files into independent pods.
from kube-fluentd-operator.
@cw-sakamoto In my previous comment I assumed you have two log files produced by the same container in a single pod.
If the logs files are produced by different containers then you can solve your case even with the current version by using the _container
meta-label:
<match $labels(msg=hello, _container=cont1)>
@type test123
</match>
<match $labels(msg=hello, _container=cont2)>
@type test456
</match>
from kube-fluentd-operator.
@jvassev Thanks for your comments.
the same container in a single pod.
You are right. I assume the same container.
It can be solved by #26 (comment) , however I thought that it is difficult to distinguish from label of k8s itself by this writing style.
In general kube-fluentd-operator tries to step away from the fluentd tag. Instead, it promotes Kubernetes labels.
Under this basic idea, I think that my proposal(add fluentd tag) is difficult, so think a little more...🤔
from kube-fluentd-operator.
This is just idea...add $labels
meta_label _file
(or _path
) like _container
$labels(msg=hello, _file=/var/log/hello.log)
or
$labels(msg=hello, _path=/var/log/hello.log)
What do you think this idea?
from kube-fluentd-operator.
I thinks it's better to use add_labels
because labels values have strict format validation. A path can contain =
, ,
,
which will confuse the $labels macro
from kube-fluentd-operator.
The add_labels
feature is now merged.
from kube-fluentd-operator.
Related Issues (20)
- Support for image.registry within log-router helm chart
- Deleted files not released under extreme load HOT 2
- Exception thrown when `detect_exceptions` filter is not being used HOT 2
- Add InstanceID in the ENV for fluentd helm charts HOT 1
- Opensearch plugin support
- More of a question HOT 1
- docs(README.md): missing documentation on admins-ns HOT 1
- docs(FluentdConfig): instructions for installing without helm produce decoding error HOT 1
- docs(releases): Release documentation v1.16.5 missing enhancement
- install fluent-plugin-dynatrace in base-image
- Failed to make build-image HOT 1
- Could somebody show the link of video `meetup-2018-11-22`, i googled for a long time, not found any. HOT 1
- We are seeing log delay/missing on KFO HOT 2
- Wrong helm values processing in secret.yaml template
- Huge increase in docker image size HOT 4
- v1.17.5 log level setting debug will trigger a crash HOT 3
- Namespace Selector Flag Based on Namespace Labels
- Support for injecting podLabels to the daemonset when deploying using the helm-chart HOT 2
- fluent-plugin-verticajson v0.0.6 Incompatible with Ruby 3.x
- Release 1.8.2 is missing `log-router-0.4.0.tgz` artifact HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kube-fluentd-operator.