Logstash在端口9600上启动2 - 3秒后关闭

f1tvaqid  于 2022-12-09  发布在  Logstash
关注(0)|答案(2)|浏览(297)

我在windows上,我命令logstash目录,并运行它与

.\bin\logstash.bat -f ..\simple-config.conf

我的.conf文件是:

input {
file {
    type=>"users-ws-log"
    path=>"C:/Users/nsun/Desktop/Education/Spring_Micro/workspace/PhotoAppApiUsers/users-ws.log"
}
file {
    type=>"albums-ws-log"
    path=>"C:/Users/nsun/Desktop/Education/Spring_Micro/workspace/PhotoAppApiAlbums/albums-ws.log"
}
    }
    output {

        if[type] == "users-ws-log" {

            elasticsearch {
                hosts => ["localhost:9200"]
                index => "users-ws-%{+YYYY.MM.dd}"
            }

        } else if[type] == "albums-ws-log" {

            elasticsearch {
                hosts => ["localhost:9200"]
                index => "albums-ws-%{+YYYY.MM.dd}"
            }

        }

        stdout { codec => rubydebug }
    }

我试过使用\,/,\的路径,但是没有一个解决这个问题。我看到其他人说每一行都需要以换行符结束,所以我在最后一行添加了回车符,但是它没有解决这个问题。
控制台输出为:

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules (file:/C:/Users/nsun/Desktop/Misc_Programs/ELK/logstash-7.8.0/logstash-core/lib/jars/jruby-complete-9.2.11.1.jar) to field java.io.Console.cs
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Sending Logstash logs to C:/Users/nsun/Desktop/Misc_Programs/ELK/logstash-7.8.0/logs which is now configured via log4j2.properties
[2020-06-19T19:27:35,594][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2020-06-19T19:27:35,676][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"7.8.0", "jruby.version"=>"jruby 9.2.11.1 (2.5.7) 2020-03-25 b1f55b1a40 Java HotSpot(TM) 64-Bit Server VM 13.0.2+8 on 13.0.2+8 +indy +jit [mswin32-x86_64]"}
[2020-06-19T19:27:36,050][INFO ][logstash.config.source.local.configpathloader] No config files found in path {:path=>"C:/Users/nsun/Desktop/Misc_Programs/ELK/simple-config.conf"}
[2020-06-19T19:27:36,073][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.
[2020-06-19T19:27:36,492][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600}
[2020-06-19T19:27:41,167][INFO ][logstash.runner          ] Logstash shut down.

感谢所有的建议。

1l5u6lss

1l5u6lss1#

我发现了我的问题,一个非常愚蠢的问题-〉simple-config.conf在源代码目录中,所以它应该是.\bin\logstash.bat-f simple-config.conf,现在它工作了

osh3o9ms

osh3o9ms2#

我已经修复了这个问题。在我的例子中,输出块没有正确地用花括号关闭。

相关问题