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

eagle-log无法sink到kafka,redis、es #8

Open
w4lker opened this issue Dec 4, 2020 · 6 comments
Open

eagle-log无法sink到kafka,redis、es #8

w4lker opened this issue Dec 4, 2020 · 6 comments

Comments

@w4lker
Copy link

w4lker commented Dec 4, 2020

请问,是否要满足特定条件,才能调用sinkToRedis或者sinkLogToKafka。
因为我这边是自己根据logSchema的格式,自己写了一些日志进去,日志格式如下:
{"id":"1","type":"test","index":"eagle_log_1","timestamp":"2020-12-04T10:01:08.634+0800","@timestamp":"1607064573799","ip":"172.19.88.67","message":"test","path":"c://test","fields":"aaa"}

timestamp和@timestamp是动态的,其他字段都是硬编码写入到kafka,我调试代码,logprocess相关方法都会调用,但是sink日志到redis,kafka的代码都不会执行。

@luxiaoxun
Copy link
Owner

针对"index":"eagle_log_1" 这个日志,你有“解析规则”吗?你整个任务都报错了,debug看看

@w4lker
Copy link
Author

w4lker commented Dec 4, 2020

规则是有解析的,我直接精简了规则,规则中只有一个logger输出信息,是没有问题的。所以是需要满足规则才会输出到redis吗?现在是报这个错误。
image

@luxiaoxun
Copy link
Owner

"规则中只有一个logger输出信息" ,那就是没有处理后的日志输出。
我更新了下LogStatWindowFunction,修复了一个没有数据会抛出异常的问题。

@w4lker
Copy link
Author

w4lker commented Dec 16, 2020

非常感谢更新,但是问题依然存在。也非常抱歉,因为我没有把错误代码贴全,“Could not forward element to next operator”不是根本原因,这个错误是由com.alarm.eagle.redis.LogStatWindowResult无法初始化造成的。请再帮忙看下,感激万分。
image

@w4lker
Copy link
Author

w4lker commented Dec 17, 2020

把LogStatWindowResult的构造函数中的super类构造代码注释掉,程序便不会报错
image

@FantasticLiar
Copy link

非常感谢更新,但是问题依然存在。也非常抱歉,因为我没有把错误代码贴全,“Could not forward element to next operator”不是根本原因,这个错误是由com.alarm.eagle.redis.LogStatWindowResult无法初始化造成的。请再帮忙看下,感激万分。
image

我也遇到了这个问题,增加一个无参构造器就可以了

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

No branches or pull requests

3 participants