Logstash supports the following patterns wherever glob patterns are allowed:
*
*
to restrict other values in the glob.For example,
*conf
matches all files that end in
conf
.
*apache*
matchesany files with
apache
in the name. This pattern does not match hidden files(dot files) on Unix-like operating systems. To match dot files, use a patternlike
{*,.*}
.
**
?
[set]
[a-z]
. Also supports set negation(
[^a-z]
).
{p,q}
p
or literal
q
. The matching literal can be more than onecharacter, and you can specify more than two literals. This pattern is the equivalentto using alternation with the vertical bar in regular expressions (
foo|bar
).
\
c:\foo*
will not work, so use
foo*
instead.
Here are some common examples of glob patterns:
"/path/to/*.conf"
.conf
in the specified path.
"/var/log/*.log"
.log
in the specified path.
"/var/log/**/*.log
.log
in subdirectories under the specified path.
"/path/to/logs/{app1,app2,app3}/data.log"
app1
,
app2
, and
app3
subdirectories under thespecified path.