-
Notifications
You must be signed in to change notification settings - Fork 310
Closed
Description
Describe the issue
I have been trying to change the filters logLevel either in the ClusterFilters CR, but it either throws this error:
/usr/lib/ruby/gems/3.1.0/gems/fluentd-1.15.3/lib/fluent/config/basic_parser.rb:92:in `parse_error!': '@' is the system reserved prefix. Don't use '@' prefix parameter in the configuration: @log_level: at app.conf line 19,16 (Fluent::ConfigParseError)
18: @type dedot
19: @log_level: error
or this one:
flux2-system fluent-agents 2d19h False ClusterFilter/fluent-system/cluster-filters dry-run failed, error: failed to create typed patch object (fluent-system/cluster-filters; fluentd.fluent.io/v1alpha1, Kind=ClusterFilter): .spec.filters[2].parser.id: field not declared in schema...
My ClusterFilter configuration is as follows:
apiVersion: fluentd.fluent.io/v1alpha1
kind: ClusterFilter
metadata:
name: cluster-filters
labels:
filter.fluentd.fluent.io/enabled: "true"
filter.fluentd.fluent.io/tenant: "core"
spec:
filters:
- customPlugin:
config: |
<filter **>
@type dedot
de_dot_separator _
de_dot_nested ${FLUENTD_DEDOT_NESTED:=true}
</filter>
<filter kube.var.log.containers.**>
@type grep
<exclude>
key $.kubernetes.container_name
pattern ^(${FLUENTD_EXCLUDE_CONTAINERS:=fluentd|fluent-bit})$
</exclude>
</filter>
<filter kube.var.log.containers.**>
@type parser
key_name log
reserve_data true
<parse>
@type regexp
expression ^(?:[^\{]*)(?<log>\{.*\})$
</parse>
</filter>
<filter kube.var.log.containers.**>
@type parser
key_name log
reserve_data true
remove_key_name_field false
hash_value_field app_log
<parse>
@type multi_format
<pattern>
format json
</pattern>
<pattern>
format none
</pattern>
</parse>
</filter>
In the ClusterFilter CRD, the logLevel spec is at the same level as the filters:
logLevel:
description: The @log_level parameter specifies the plugin-specific
logging level
type: string
parser:
description: The filter_parser filter plugin
properties:
emitInvalidRecordToError:
description: 'Emits invalid record to @ERROR label. Invalid
cases are: key does not exist;the format is not matched;an
unexpected error. If you want to ignore these errors,
set false.'
type: boolean
hashValueField:
...
Is there a way to assign a global logLevel for all filters?
Also, how should it behave if the Fluentd logLevel is set to a different level?
How did you install fluent operator?
Via helm chart.
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels