简体   繁体   English

在Windows中使用Logstash将Apache日志导入Elasticsearch

[英]Import apache logs into elasticsearch using logstash in windows

I am very new to ELK stack and also commands in Windows cmd. 我对ELK堆栈和Windows cmd中的命令非常陌生。 I am trying to run below example into my windows machine. 我试图将以下示例运行到Windows计算机中。 I have configured installed and configured ELK stack in my machine but does not know how to run below command in Windows cmd? 我已经在计算机中配置了已安装和配置的ELK堆栈,但不知道如何在Windows cmd中的以下命令下运行?

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

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

I have tried below example but it is not working as expected. 我已经尝试过以下示例,但是它没有按预期工作。 Please help. 请帮忙。

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

You have 2 major solutions: 您有2种主要解决方案:

  1. You can use mingw (also provided with git as "git bash") to use linux style commands with pipes. 您可以使用mingw(也作为git bash提供给git)与管道一起使用linux样式命令。 (see http://www.mingw.org/ ) (请参阅http://www.mingw.org/

  2. Or you can change the apache_logstash.conf file, replacing the input section to ingest the apache log file directly instead of ingesting standard input and waiting for a pipe 或者,您可以更改apache_logstash.conf文件,替换输入部分以直接摄取apache日志文件,而不是摄取标准输入并等待管道

actual: 实际:

input {  
  stdin { } 
}

replacement : 替代 :

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM