-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Promtail kubernetes host log & drop namespace #748
Comments
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
@prasenforu Could you have your questions answered? I'm wondering the same. |
Take a look at this article. https://itnext.io/grafana-logging-using-loki-45665916aec9 |
I followed that URL but not working. Finally I moved to fluent-bit |
Q1 - We don't add the host automatically but you can use external label flags see #510 Q2 - Labels after relabeling are accessible in pipeline stage, we support dropping via the match stage so that should work now. |
@prasenforu how you able to exclude namespace in fluent-bit? |
in fluent-bit conf add in INPUT section
|
Can you please help me to get sample configuration for dorp namespace |
Drop all namespaces but "default" on promtail
This is a working example. |
This setting only works on newer versions of Promtail in Chart version: 3.6.1 Promtail version: 2.2.1 does not work. |
It might be helpful to also point out that there is a probably more efficient way to filter per namespace. Thus, this only works when it's about an include list of valid namespaces. There is the scrape_configs:
- job_name: kubernetes-pods
pipeline_stages:
- cri: {}
kubernetes_sd_configs:
- role: pod
namespaces:
names:
- default
# - another-namespace |
ℹ️ With my recent comment I just trapped into the issue mentioned here: #808 (comment) Filtering log files by e.g. just the "default" namespace led to zero matching files. Thus, nothing to be tailed by |
jfyi: putting helm values which work for me
|
Thank you for sharing your solution with us. It worked for me as well |
I am running Loki with promtail in kubernetes platform.
Promtail running as a daemonset and promtail configuration as follows ..
I have a two question?
Q1# How can I capture kubernetes host log (/var/log/messages) along with hostname and what will be config file definition?
I checked with https://github.com/grafana/loki/blob/master/docs/promtail-examples.md
But looks like its for static configuration.
Q2# How can I DROP all logs from particular namespace (default)
I tried with following but no luck, not sure if I missing anything ...
I added below text in job "kubernetes-pods" & "kubernetes-pods-app"
The text was updated successfully, but these errors were encountered: