在Windows Logstash服务中运行多个conf文件

我已经通过NSSM在Windows中将Logstash 7.1.0安装为服务。 我没有在NSSM中提供任何参数。

然后在pipelines.yml中, 我仅通过启用

设置了不同的管道
- pipeline.id: dataupdate
      path.config: "D:\logstash-7.1.0\logstash-7.1.0\bin\myupdate.conf"
 - pipeline.id: groklogs
      path.config: "D:\logstash-7.1.0\logstash-7.1.0\bin\logs.conf"

当我启动该服务时,conf文件似乎没有运行。 我假设当您在NSSM中不提供任何参数时,pipelines.yml将被定向到执行。

我需要的是在我的logstash服务中运行多个conf文件,而不会受到任何干扰。 如果我在cmd中运行,那么在我关闭cmd时它将停止,我不希望那样。 这是配置文件的内容:

logs.conf:

input {
  beats {
    port => 5044
  }
}
filter {
    grok {
match => {"message" =>"\[%{TIMESTAMP_ISO8601:timestamp}\]%{SPACE}\[%{DATA:Severity}\]%{SPACE}\[%{DATA:Plugin}\]%{SPACE}\[%{DATA:Servername}\](?<short_message>(.|\r|\n)*)"}
    }
} 
output {
  elasticsearch {
    hosts => ["localhost:9200"]
    index => "groklogs"
}
          stdout { codec => rubydebug }
}

myupdate.conf:

input {
    jdbc {
        jdbc_connection_string => "jdbc:sqlserver://mydb:1433;databasename=db01;integratedSecurity=true"
        jdbc_driver_class =>  "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    jdbc_driver_library => "C:\Program Files\sqljdbc_6.2\enu\mssql-jdbc-6.2.2.jre8.jar"
        jdbc_user => nil
        statement => "SELECT * from agedata WHERE updated_on > :sql_last_value  ORDER BY updated_on"
    use_column_value =>true
        tracking_column =>updated_on
        tracking_column_type => "timestamp"
    }
}
output {
          elasticsearch { hosts => ["localhost:9200"] 
        index => "thisisit"
        action => update
            document_id => "%{id}"
            doc_as_upsert =>true}
          stdout { codec => rubydebug }
       }

请帮助我。

lj449028498 回答:在Windows Logstash服务中运行多个conf文件

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3154387.html

大家都在问