fluent / fluent/fluent-plugin-grok-parser

Using variable as grok pattern

Open
#90 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
108
Forks
32
PR merge metrics
No merged PRs in 30d

Description

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

@type parser
enable_ruby
key_name log

@type grok
grok_pattern ${record["kubernetes"]["annotations"]["fluentd.grok"]}


```

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.