Logstash: how to add file name as a field?

前端 未结 2 741
走了就别回头了
走了就别回头了 2020-11-30 09:31

I\'m using Logstash + Elasticsearch + Kibana to have an overview of my Tomcat log files.

For each log entry I need to know the name of the file from which it came. I

2条回答
  •  有刺的猬
    2020-11-30 10:15

    Hi I added a grok filter to do just this. I only wanted to have the filename not the path, but you can change this to your needs.

    filter {
      grok {
        match => ["path","%{GREEDYDATA}/%{GREEDYDATA:filename}\.log"]
      }
    }
    

提交回复
热议问题