如何将复杂的旧日志推送到logstash?

时间:2021-01-14 08:42:17

标签: logstash filebeat elk elastic-beats

我想使用 ELK 来分析和可视化我们的 GxP 日志,这些日志是由我们的原始 LIMS 系统创建的。 至少系统运行在 SLES 上,但整个日志结构有点混乱。

我试着给你一个印象:

Main_Dir
 | Log Dir
     | Large number of sub dirs with a lot of files in them of which some may be of interest later
 | Archive Dir
     | [some dirs which I'm not interested in]
     | gpYYMM <-- subdirs created automatically each month: YY = Year ; MM = Month
        | gpDD.log <-- log file created automatically each day. 
     | [more dirs which I'm not interested in]

重要:我需要跟踪的每次体检都完全记录在表示订单输入日期的 gpDD.log 文件中。完整检查的持续时间在几分钟(如果没有可用材料)、几小时或几天(例如,Covid-19 检查需要 48 小时)甚至微生物样本的几周之间变化。示例:12 月 30 日到达我们的 Covid-19 样本的所有信息都记录在 ../gp2012/gp30.log 中,即使检查是在 1 月 4 日进行的,并且报告的验证/创建是在 1 月 5 日完成的。

您能否为我提供一些正确使用节拍的指导(我猜是 logbeat 或 filebeat)以及如何实现日志传输?

1 个答案:

答案 0 :(得分:0)

Logstash 文件输入:

input {
  file {
    path => "/Main Dir/Archive Dir/gp*/gp*.log"
  }
}

Filebeat 输入:

- type: log
  paths:
    - /Main Dir/Archive Dir/gp*/gp*.log

在这两种情况下,路径都是可能的,但是如果您需要进一步处理这些行,我建议至少使用 Logstash 作为传递(如果您不想在源本身上安装 Logstash,则使用 beats 输入,这可以可以理解)