将 logstash 配置文件所需的文件放在我的 ec2 实例上的什么位置?

Where to put the files needed by the logstash configuration file on my ec2 instance?

我的 logstash 配置文件如下所示:

input {
    file {
        path => "/home/ec2-user/apache_logs"
        start_position => "beginning"
    }
}

filter {
  grok {
    match => {
      "message" => '%{COMMONAPACHELOG} %{QS}%{QS}'
    }
  }

  date {
    match => [ "timestamp", "dd/MMM/YYYY:HH:mm:ss Z" ]
    locale => en
  }

  geoip {
      source => "clientip"
    }

  useragent {
    source => "agent"
    target => "useragent"
  }
}
.....

现在我输入的路径出错了:

This setting must be a path .. File does not exist or cannot be opened

我的 apache_logs 文件应该放在哪里?

您只需要说出目录中要观看的文件即可。
可以通过像这样修改 file 输入来完成:

input {
    file {
        path => "/home/ec2-user/apache_logs/*.*"
        start_position => "beginning"
    }
}

这将跟在 /home/ec2-user/apache_logs/

中的所有文件之后