Skip to content
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

bug: The filter is created in the incorrect order. #930

Open
onap4105 opened this issue Sep 18, 2023 · 1 comment
Open

bug: The filter is created in the incorrect order. #930

onap4105 opened this issue Sep 18, 2023 · 1 comment

Comments

@onap4105
Copy link

Describe the issue

I attempted to create the filter order as shown below, but the order ended up reversed. I tested by creating the second filter 2-3 minutes after the first filter, but the later-created filter still appeared in front of the first filter.
[Filter]
Name rewrite_tag
Match kube.*
Rule $kubernetes['namespace_name'] hwapp-ns hwapp_ns_tag true
Emitter_Name hwapp_ns
[Filter]
Name rewrite_tag
Match hwapp_ns_tag
Rule $log (log-pattern) app_log_tag true
Emitter_Name hwapp_log

To Reproduce

created following manifest files and applied one by one

kind: ClusterFilter
metadata:
name: kubernetes-hwapp-ns
annotations:
meta.helm.sh/release-name: fluent-operator
meta.helm.sh/release-namespace: fluentbit
labels:
app.kubernetes.io/managed-by: Helm
fluentbit.fluent.io/enabled: "true"
fluentbit.fluent.io/component: logging
spec:
match: kube.*
filters:

  • rewriteTag:
    emitterName: hwapp_ns
    rules:
    • $kubernetes['namespace_name'] hwapp-ns hwapp_ns_tag true

apiVersion: fluentbit.fluent.io/v1alpha2
kind: ClusterFilter
metadata:
name: kubernetes-hwapp-log
annotations:
meta.helm.sh/release-name: fluent-operator
meta.helm.sh/release-namespace: fluentbit
labels:
app.kubernetes.io/managed-by: Helm
fluentbit.fluent.io/enabled: "true"
fluentbit.fluent.io/component: logging
spec:
match: hwapp_ns_tag
filters:

  • rewriteTag:
    emitterName: hwapp_log
    rules:
    • $log (log-pattern) app_log_tag true

Expected behavior

see this order in secret fluent-bit-config fluent-bit.conf
[Filter]
Name rewrite_tag
Match kube.*
Rule $kubernetes['namespace_name'] hwapp-ns hwapp_ns_tag true
Emitter_Name hwapp_ns
[Filter]
Name rewrite_tag
Match hwapp_ns_tag
Rule $log (log-pattern) app_log_tag true
Emitter_Name hwapp_log

Your Environment

- Fluent Operator version:v2.1.0
- Container Runtime:v2.0.9
- Operating system: Ubuntu 1.25
- Kernel version:

How did you install fluent operator?

No response

Additional context

No response

@onap4105 onap4105 changed the title bug: bug: The filter is created in the incorrect order. Sep 18, 2023
@cw-Guo
Copy link
Collaborator

cw-Guo commented Oct 23, 2023

This is actually not a bug.

the resources are ordered lexicographically by the resource metadata.name currently.

check #693 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants