gpt4 book ai didi

windows - Fluentbit 创建 TCP 连接

转载 作者:行者123 更新时间:2023-12-04 14:06:34 24 4
gpt4 key购买 nike

Fluentbit 创建到自身的 TCP 连接?

这些有什么用?

fluent.conf 文件:

[SERVICE]
Flush 5
Daemon Off
Log_Level debug

[INPUT]
Name tail
Tag format.logging
path C:\Logs\*main.log
DB C:\Logs\main_logs.db

[OUTPUT]
Name stdout
Match *

enter image description here

最佳答案

这似乎归结为一个实现细节,它在 Linux 上使用 unix 套接字作为其事件循环,但在 Windows 上它选择使用 localhost-connections。

来自 https://github.com/fluent/fluent-bit/blob/37aa680d32384c1179f02ee08a5bef4cd278513e/lib/monkey/mk_core/deps/libevent/include/event2/util.h#L380 的评论

/** Create two new sockets that are connected to each other.
On Unix, this simply calls socketpair(). On Windows, it uses the
loopback network interface on 127.0.0.1, and only
AF_INET,SOCK_STREAM are supported.
(This may fail on some Windows hosts where firewall software has cleverly
decided to keep 127.0.0.1 from talking to itself.)
Parameters and return values are as for socketpair()
*/

实际实现在这里:https://github.com/fluent/fluent-bit/blob/37aa680d32384c1179f02ee08a5bef4cd278513e/lib/monkey/mk_core/deps/libevent/evutil.c#L207

它与查看 netstat 输出时的模式匹配:

netstat -anop tcp | findstr <fluentbit pid>
TCP 127.0.0.1:54645 127.0.0.1:54646 ESTABLISHED 12012 \
TCP 127.0.0.1:54646 127.0.0.1:54645 ESTABLISHED 12012 ´` Pair

TCP 127.0.0.1:54647 127.0.0.1:54648 ESTABLISHED 12012 \
TCP 127.0.0.1:54648 127.0.0.1:54647 ESTABLISHED 12012 ´` Pair

关于windows - Fluentbit 创建 TCP 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68255280/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com