fluent / fluent/fluent-plugin-grok-parser
Using variable as grok pattern
- 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.