【问题标题】:wild card search in logstash.conf for files在 logstash.conf 中搜索文件的通配符
【发布时间】:2020-05-15 13:06:26
【问题描述】:

我是 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"
  }
}

【问题讨论】:

    标签: logstash logstash-grok logstash-configuration


    【解决方案1】:

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

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

    排除项(与文件名匹配,而不是完整路径)。文件名 模式在这里也有效。例如,如果您有

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-25
      • 1970-01-01
      • 2012-08-24
      • 2011-03-21
      • 1970-01-01
      • 2019-05-10
      • 1970-01-01
      • 2021-10-29
      相关资源
      最近更新 更多