如何将复杂的遗留日志推送到logstash中?



我想使用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),以及如何实现日志传输?

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输入,这是可以理解的)

最新更新