【问题标题】:How to send syslog to graylog如何将 syslog 发送到 graylog
【发布时间】:2016-01-20 22:03:09
【问题描述】:

我们有很多 Centos 客户端(Centos 5-7)。我希望所有客户端都通过 syslog 将日志发送到 graylog 服务器。这适用于安装了 rsyslog 的客户端。但是老客户没有rsyslog。他们使用系统日志。

我应该在/etc/syslog.conf 文件中进行哪些更改才能使其正常工作? 感谢您的帮助。

【问题讨论】:

  • 有人可以帮忙吗?我还试过这个:1.)我将远程服务器(graylog 服务器)的 IP 添加到 /etc/syslog.conf: *.* @IP-ADDRESS 2.)我将 /etc/sysconfig/syslog 中的 -r 参数添加到 SYSLOGD_OPTIONS="-r -m 0" 3.)service syslog restart 但它没有不行。我在 graylog 服务器上没有任何日志。我能做什么?

标签: logging centos send syslog graylog


【解决方案1】:

对其他客户端使用 graylog-collector :

我对 graylog-collector 的配置:

server-url = "http://192.168.254.184:12900/"

inputs {
  win-eventlog-application {
    type = "windows-eventlog"
    source-name = "Application"
    poll-interval = "1s"
  }
  win-eventlog-system {
    type = "windows-eventlog"
    source-name = "System"
    poll-interval = "1s"
  }
  win-eventlog-security {
    type = "windows-eventlog"
    source-name = "Security"
    poll-interval = "1s"
  }
}

outputs {
  gelf-tcp {
    type = "gelf"
    host = "192.168.254.184"
    port = 12201
  }
}

只需在 graylog2 接口中为 GELF 格式创建一个输入!

【讨论】:

    【解决方案2】:

    您使用旧的 syslog 还是 syslog-ng?如果您使用 syslog,则无法更改输出格式,但如果您使用 syslog-ng,请尝试:

    # Define TCP syslog destination.
    destination d_net {
        syslog("graylog.example.org" port(514));
    };
    # Tell syslog-ng to send data from source s_src to the newly defined syslog destination.
    log {
        source(s_src); # Defined in the default syslog-ng configuration.
        destination(d_net);
    };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多