logstash无法运行配置

时间:2019-12-18 07:28:44

标签: elasticsearch logstash config logstash-grok

我在客户端上使用filebeat>在服务器端使用logstash>在服务器端使用elasticsearch

客户端上的

filebeat通过发送文件可以正常工作,但是我在logstash返回时所做的配置

失败

[WARN ] 2019-12-18 14:53:30.987 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified
[FATAL] 2019-12-18 14:53:31.341 [LogStash::Runner] runner - Logstash could not be started because there is already another instance using the configured data directory.  If you wish to run multiple instances, you must change the "path.data" setting.
[ERROR] 2019-12-18 14:53:31.364 [LogStash::Runner] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

这是我的配置文件

input {
 beats {
  port =>5044
}
}
filter {
        grok    {
                 match => { "message" =>"%{TIMESTAMP_ISO8601:timestamp}] %{WORD:test}\[%{NUMBER:nom}]\[%{DATA:tes}\] %{DATA:module_name}\: %{WORD:method}%{GREEDYDATA:log_message}" }
                }
        }
output {
         elasticsearch
        {
        hosts => "127.0.0.1:9200"
        index=>"test_log_pbx"
}
}

代码以运行我的logstash配置

/usr/share/logstash/bin/logstash -f logstash.conf

当我运行configtest时,它会返回

Thread.exclusive is deprecated, use Thread::Mutex
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console
[WARN ] 2019-12-18 14:59:53.300 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified
[INFO ] 2019-12-18 14:59:56.566 [LogStash::Runner] Reflections - Reflections took 139 ms to scan 1 urls, producing 20 keys and 40 values
Configuration OK
[INFO ] 2019-12-18 14:59:57.923 [LogStash::Runner] runner - Using config.test_and_exit mode. Config Validation Result: OK. Exiting Logstash

请帮助我,我不知道怎么了

1 个答案:

答案 0 :(得分:1)

一个logstash实例已经在运行,所以你不能运行另一个实例。如果你把logstash设置为服务,你应该停止该服务。如果你想运行多个实例,你应该修改 pipelines.yml

如果你想了解更多关于 pipelines.yml,我把链接放在下面。

<块引用>

https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html