【发布时间】:2016-01-27 19:31:27
【问题描述】:
我特别需要知道如何将我从任何人那里收到的日志文件“导入”到 Graylog。我需要的不是“发送”或配置将向 Graylog 发送日志的收集器。
我需要知道是否可以将带有日志的 TAR 复制到 graylog 并通过 Graylog 的 Web UI 呈现内容。
我阅读了很多博客,但我很难找到满足我特定需求的指导。
非常感谢您的帮助
【问题讨论】:
标签: graylog
我特别需要知道如何将我从任何人那里收到的日志文件“导入”到 Graylog。我需要的不是“发送”或配置将向 Graylog 发送日志的收集器。
我需要知道是否可以将带有日志的 TAR 复制到 graylog 并通过 Graylog 的 Web UI 呈现内容。
我阅读了很多博客,但我很难找到满足我特定需求的指导。
非常感谢您的帮助
【问题讨论】:
标签: graylog
据我所知,无法导入日志,但您可以使用 fluentd(http://www.fluentd.org/guides/recipes/graylog2) 读取日志文件。
但是如果你想将日志文件从 apache 发送到 graylog 试试这个,在 apache2.conf 中添加以下行:
LogFormat "{ \"version\": \"1.1\", \"host\": \"%V\", \"short_message\": \"%r\", \"timestamp\": %{%s}t, \"level\": 6, \"_user_agent\": \"%{User-Agent}i\", \"_source_ip\": \"%a\", \"_duration_usec\": %D, \"_duration_sec\": %T, \"_request_size_byte\": %O, \"_http_status\": %s, \"_http_request_path\": \"%U\", \"_http_request\": \"%U%q\", \"_http_method\": \"%m\", \"_http_referer\": \"%{Referer}i\" }" graylog2_access
并在您的虚拟主机文件中添加以下行:
CustomLog "|/bin/nc -u syslogserver.example.de 50520" graylog2_access
也看看这里:https://serverfault.com/questions/310695/sending-logs-to-graylog2-server
【讨论】: