Logstash转发器作为Windows服务 [英] Logstash-forwarder as Windows Service

查看:164
本文介绍了Logstash转发器作为Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力为Windows 2008 R2 Server上的logstash转发器创建一个Windows服务。



我的设置如下:



Ubuntu服务器14.04 LTS




  • 弹性搜索

  • Logstash

  • Kibana



Windows Server 2008 R2:



<
  • 通过Logstash转发器将日志发送到ELK堆栈



  • 我目前正在使用Windows编译的Logstash转发器,使用这里的说明将日志成功发送到ELK-Stack ... https://github.com/elastic/logstash-forwarder 。唯一的问题是,我必须在CLI窗口中运行logstash转发器,我无法将其设置为Windows服务。



    ve尝试了以下SC命令,该服务已创建,但服务根本无法启动。只需返回以下错误:服务没有及时响应启动或控制请求。

      sc create LogstashForwarder binpath =\C:\_Logstash\logstash-forwarder.exe\-config = \C:\_Logstash\logstash-forwarder.conf\start = Auto displayname =Logstash转发器

    不幸的是Google也不知道任何答案。



    有没有人能够使用SC命令在Windows上启动logstash转发器作为Windows服务?一些很好的建议将非常感激。

    解决方案

    如果您的logstash配置正确,请尝试这些步骤。


    1. 获取 nssm

    2. 解压缩nssm zip logstash的bin文件夹

    3. 从命令行显示 nssm install logstash


    4. 在启动的配置屏幕上添加您的蝙蝠的路径


    5. 添加您的启动目录。

    这里您可以获得更多帮助



    https://blog.basefarm.com/blog/how-to-install-logstash-on-windows- server-2012-with-kibana-in-iis /



    https://github.com/verbosemode/public-notes/blob/master/logstash-windows.md



    希望thi帮助


    I'm struggling to create a Windows Service for a logstash forwarder on Windows 2008 R2 Server.

    My setup looks as follows:

    Ubuntu Server 14.04 LTS

    • Elasticsearch
    • Logstash
    • Kibana

    Windows Server 2008 R2:

    • Application logging to a certain path.
    • Ship logs to the ELK Stack via Logstash-forwarder

    I'm currently shipping logs successfully to the ELK-Stack via Logstash forwarder compiled for Windows using the instructions here... https://github.com/elastic/logstash-forwarder. The only problem is, that I have to run the logstash forwarder in a CLI window, and I'm not able to set it up as a Windows Service.

    I've tryed the following SC command, the service is created but the service will not start at all. Just returning the following error: The service did not respond to the start or control request in a timely fashion.

    sc create LogstashForwarder binpath= "\"C:\_Logstash\logstash-forwarder.exe\" -config=\"C:\_Logstash\logstash-forwarder.conf\"" start= Auto displayname= "Logstash forwarder" 
    

    Unfortunately Google does not know any answer either.

    Does anyone have been able to start the logstash forwarder on Windows as a Windows Service with the SC command? Some good advice will be very appreciated.

    解决方案

    If your logstash configuration is correct try these steps.

    1. Get nssm soft
    2. Decompress the nssm zip in the bin folder of logstash
    3. Excecute from command line nssm install logstash

    4. Add the path to your bat on the launched config screen

    5. Add your startup directory too.

    Here you can get some more help

    https://blog.basefarm.com/blog/how-to-install-logstash-on-windows-server-2012-with-kibana-in-iis/

    https://github.com/verbosemode/public-notes/blob/master/logstash-windows.md

    Hope this help

    这篇关于Logstash转发器作为Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆