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: parser not found #986

Open
kakaNo1 opened this issue Nov 10, 2023 · 2 comments
Open

bug: parser not found #986

kakaNo1 opened this issue Nov 10, 2023 · 2 comments

Comments

@kakaNo1
Copy link

kakaNo1 commented Nov 10, 2023

Describe the issue

When I create a parser:

kind: Parser
metadata:
  labels:
    owner: xx
  name: json
  namespace: xx
spec:
  json:
    timeFormat: "%Y-%m-%dT%H:%M:%S.%f%z"
    timeKeep: true
    timeKey: "asctime"

The program will follow my name+namespace (md5). Add a new parser in sercret=fluent-bit-config, as follows:

[PARSER]
    Name    json-18d05c21d7896d5de2e35dced7644xxx
    Format    json
    Time_Key    asctime
    Time_Format    %Y-%m-%dT%H:%M:%S.%f%z
    Time_Keep    true

I referenced this in the Filter

apiVersion: fluentbit.fluent.io/v1alpha2
kind: Filter
metadata:
  name: kubernetes
  ...
  - parser:
      keyName: log
      parser: json

However, the collector may have the following errors:

[2023/09/12 07:20:28] [error] [filter:parser:parser.14] requested parser 'json-18d05c21d7896d5de2e35dced7644xxx-18d05c21d7896d5de2e35dced7644xxx-18d05c21d7896d5de2e35dced7644xxx-18d05c21d7896d5de2e35dced7644xxx' not found
[2023/09/12 07:20:28] [error] [filter:parser:parser.14] Invalid 'parser'
[2023/09/12 07:20:28] [error] Failed initialize filter parser.14
[2023/09/12 07:20:28] [error] [engine] filter initialization failed

To Reproduce

But when I add parsers, this error always occurs

Expected behavior

If I add a new parser named test1, there will be test1 namespace (md5) when creating it, instead of test1 namespace(md5)-namespace(md5)-namespace(md5)-namespace(md5)-namespace(md5)..

Your Environment

- Fluent Operator version:  2.4
- Container Runtime:
- Operating system:
- Kernel version:

How did you install fluent operator?

No response

Additional context

No response

@wenchajun
Copy link
Member

The md5 suffix will not be added normally.
https://github.com/fluent/fluent-operator/blob/master/apis/fluentbit/v1alpha2/plugins/parser/json_types.go
How did this come about?

@kakaNo1
Copy link
Author

kakaNo1 commented Nov 27, 2023

Can you give me a correct example? I want to use JSON's Parser in the namespace @wenchajun

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