Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复版本比对异常,日志添加时间类型 #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vine2024
Copy link

No description provided.

feat:日志添加时间类型
@kevwan
Copy link
Owner

kevwan commented Jul 12, 2024

Thanks for your contribution!

Would you please add details on what problems this PR fix?

@vine2024
Copy link
Author

Thanks for your contribution!

Would you please add details on what problems this PR fix?

修复问题:

if isSupportType(w.esVersion) && len(w.docType) > 0 {
req = req.Type(w.docType)
}

es版本使用的是6.8.18,需要传入typ参数,但是目前版本号比较有点问题导致一直不会传入改参数。调用semver.Compare()比较方法传入的参数必须带“v”字符串才能正确比对。

另外,kibana创建日志查询需要根据time类型来排序,但目前日志内容转成一个string整体,导致拿不到time类型的字段,所以我把写入的参数val string类型改成了map[string]interface{}并加上了m["timestamp"] = time.Now()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants