gpt4 book ai didi

How to use td-agent-bit to output log files as messages?(如何使用TD-AGENT-BIT将日志文件作为消息输出?)

转载 作者:bug小助手 更新时间:2023-10-24 19:49:34 29 4
gpt4 key购买 nike



How to use td-agent-bit to output log files as messages, either on a per-line basis or for lines that start with "HH:mm:ss," and send them downstream, instead of outputting multiple lines of logs together each time?
logs:

如何使用TD-AGENT-BIT将日志文件作为消息输出,可以是逐行输出,也可以是以“hh:mm:ss”开头的行输出,然后向下游发送,而不是每次一起输出多行日志?日志:




15:42:43 [cmd:local,tid:xxx]
15:42:43 [tid:xxx]




I want messages like below:

我想要下面这样的消息:




{
"message":" 15:42:43 [cmd:local,tid:xxx]",
"type":"test-log",
"@version":"1",
"port":31426,
"@timestamp":"2023-09-08T10:59:45.806Z",
"host":"172.31.48.61"
}

{
"message":" 15:42:43 [tid:xxx] ",
"type":"test-log",
"@version":"1",
"port":31426,
"@timestamp":"2023-09-08T10:59:45.806Z",
"host":"172.31.48.61"
}




not:

不是:




{
"message":" 15:42:43 [cmd:local,tid:xxx] 15:42:43 [tid:xxx]",
"type":"test-log",
"@version":"1",
"port":31426,
"@timestamp":"2023-09-08T10:59:45.806Z",
"host":"172.31.48.61"
}




更多回答
优秀答案推荐
更多回答

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