简体   繁体   中英

Import apache logs into elasticsearch using logstash in windows

I am very new to ELK stack and also commands in Windows cmd. I am trying to run below example into my windows machine. I have configured installed and configured ELK stack in my machine but does not know how to run below command in 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

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:

  1. You can use mingw (also provided with git as "git bash") to use linux style commands with pipes. (see 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

actual:

input {  
  stdin { } 
}

replacement :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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