【问题标题】:Import apache logs into elasticsearch using logstash in windows在windows中使用logstash将apache日志导入elasticsearch
【发布时间】:2017-04-24 03:18:02
【问题描述】:

我对 ELK 堆栈和 Windows cmd 中的命令非常陌生。我正在尝试将以下示例运行到我的 Windows 机器中。我已经在我的机器中配置了已安装和配置的 ELK 堆栈,但不知道如何在 Windows cmd 中运行以下命令?

https://github.com/elastic/examples/tree/master/ElasticStack_apache

cat apache_logs | <path_to_logstash_root_dir>/bin/logstash -f apache_logstash.conf

我尝试了下面的示例,但它没有按预期工作。请帮忙。

type apache_logs >> C:\logstash-5.3.1\bin\logstash.bat -f apache_logstash.conf

【问题讨论】:

    标签: windows elasticsearch logstash kibana elastic-stack


    【解决方案1】:

    您有 2 个主要解决方案:

    1. 您可以使用 mingw(也与 git 一起提供为“git bash”)来使用带有管道的 linux 样式命令。 (见http://www.mingw.org/

    2. 或者您可以更改 apache_logstash.conf 文件,替换 input 部分以直接摄取 apache 日志文件,而不是摄取标准输入并等待管道

    实际:

    input {  
      stdin { } 
    }
    

    替换:

    input {
        file {
            path => "<path_to_apache_log_file>"
            start_position => "beginning"
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-30
      • 2014-12-05
      • 1970-01-01
      • 1970-01-01
      • 2015-12-12
      • 1970-01-01
      • 2018-01-10
      • 2021-09-14
      相关资源
      最近更新 更多