如何将日志从 Vagrant 服务器发送到 Graylog 服务器

How to send log from Vagrant server to Graylog server

我是遇到此类问题的新手,但是我必须将日志数据从 Vagrant 服务器发送到安装了 Graylog 的本地计算机。我在我的本地机器上安装了 docker 工具,其中 graylog、mongo 和 elasticsearch 已启动并且 运行。 Elasticsearch 将用于搜索特定日志。我在第一台机器(Vagrant)上有日志,想将它们发送到另一台机器(graylog 在哪里)。伙计们,你们有一些循序渐进的教程或提示等吗?我坚持这个问题,不知道如何进一步...

好的,我找到了解决方案。我只需要将数据发送到我的 graylog 服务器并在 graylog 上打开端口(Kitematic 是查看 docker 配置(即端口)有什么问题的好工具)。我通过将数据写入 /dev/udp 文件来发送日志,如下所示:

cd /home/iso/myAppFolder/myAppLogs; tail -f myAppLogs.log | grep totalTime > /dev/udp/[ip of my graylog]/[port] &