logstash.conf 中的通配符搜索文件

wild card search in logstash.conf for files

我是 ELK 的新手,尝试将日志文件加载到 elastic search 中,但成功了。 现在计划将特定文件夹中的所有日志文件加载到 elastic search 下面是配置文件中的 input 部分。我在那里有一个正则表达式来加载 test2312312.logtest35353.logtest743432.log 等文件。该表达式应忽略 testserver.logtestprocess.log

等文件

下面的正则表达式曾经在 Python 中工作,但在 GROK 中不起作用。有人可以帮我吗?

input {
  file {
    path => "C:/Users/myself/Downloads/ELK/test(?=[0-9]).log"
    start_position => "beginning"
    sincedb_path => "NULL"
  }
}

文件中的路径不支持正则表达式。它只支持通配符。

您可以使用 exclude 属性 接受数组 exclude 某些文件

Exclusions (matched against the filename, not full path). Filename patterns are valid here, too. For example, if you have