You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion was converted from issue #1545 on March 05, 2025 07:43.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
业务pod容器宿主机挂载,并且业务pod正常输出到日志文件:
volumeMounts:
- mountPath: /var/log/als/file/output/
name: volume1
volumes:
path: /app/logs/
type: ""
name: volume1
配置采集规则的input:
"inputs" : [ {
"Type" : "input_file",
"FilePaths" : [ "/var/log/**/random_json_file_.log" ],
"MaxDirSearchDepth" : 5,
"ExcludeFilePaths" : [ ],
"TailSizeKB" : 0,
"EnableContainerDiscovery" : true,
"ContainerFilters" : {
"K8sNamespaceRegex" : "rule-verify-namespace",
"K8sPodRegex" : "hostpath-json-"
},
"AppendingLogPositionMeta" : true,
"AllowingIncludedByMultiConfigs" : true
} ],
原因:没有匹配到正确的挂载点,StartsWith("/var/log", "/var/log/als/file/output")这里是false ,而是使用了容器内的overlay路径,因此采不到。
日志:
set container base dir:/lmtagent_host/data/docker/overlay2/4997753881ff76a72d83f61d622324e2fb21a8d48e12c914e4b812483e1202fc/diff/var/log container id:92a89d9354a5a3692ab5f51323bcd7170efc5580a59676ba1a2af35645ce821f logPath:/var/log
InputFile.cpp 代码:
bool InputFile::SetContainerBaseDir(ContainerInfo& containerInfo, const std::string& logPath, const std::string& configName) {
if (!containerInfo.mRealBaseDir.empty()) {
return true;
}
size_t pthSize = logPath.size();
}
Beta Was this translation helpful? Give feedback.
All reactions