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

Using variable as grok pattern #90

Open
dudicoco opened this issue Dec 15, 2020 · 0 comments
Open

Using variable as grok pattern #90

dudicoco opened this issue Dec 15, 2020 · 0 comments

Comments

@dudicoco
Copy link

Hi all, I want to use a k8s annotation as my grok value, I have tried the following:

    <filter kubernetes.**>
      @type parser
      enable_ruby
      key_name log
      <parse>
        @type grok
        grok_pattern ${record["kubernetes"]["annotations"]["fluentd.grok"]}
      </parse>
    </filter>

Annotation:

fluentd.grok: "%{LOGLEVEL:severity}"

I'm getting the following error:

│ 2020-12-15 16:10:29 +0000 [info]: Expanded the pattern ${record["kubernetes"]["annotations"]["fluentd.regexp"]} into ${record["kubernetes"]["annotations"]["fluentd.regexp"]}                                                                                                                                            │
│ 2020-12-15 16:10:29 +0000 [error]:  error_class=Fluent::ConfigError error="No named captures in 'expression' parameter. The regexp must have at least one named capture"                                                                                                                                                 │
│ 2020-12-15 16:10:29 +0000 [error]: config error file="/fluentd/etc/fluent.conf" error_class=Fluent::ConfigError error="no grok patterns. Check configuration, e.g. typo, configuration syntax, etc"

Can someone please advise?
Thanks!

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

1 participant