fluent / fluentd-docs

This repository is deprecated. Go to fluentd-docs-gitbook repository.
49 stars 119 forks source link

filter-grep: Explain how to use a pattern with a leading slash #538

Closed fujimotos closed 6 years ago

fujimotos commented 6 years ago

This patch is my attempt to prevent a class of issues reported by #515.

Problem

Right now, Fluentd assumes that a match pattern with a leading slash is written in the regex notation (something like "/foo/").

This can lead to a confusing result if a user naively sets a file path as a pattern. For example, the following configuration will be parsed to RegExp(//), not RegExp(/var/log/):

<regexp>
  key "path"
  pattern /home
</regexp>

Solution

This patch adds a small note to describe how to specify such patterns properly.