-
Notifications
You must be signed in to change notification settings - Fork 392
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
[BUG]: 从kafka采集后写入es异常. #1748
Comments
可能得看下原始kafka里日志的内容 |
kafka中的内容就是原始的内容 12345 , 同样的内容,如果从文件中采集,发往es的是 "content":"12345",如果从kafka采集,就变成了"":"12345" ,然后就被es忽略了. |
好像知道是什么原因了, kafka input 插件用的是version: 1.0.0, v1版本会读kafka消息中的key来作为key, 然后我们往kafka中发数据的时候也没指定key, 而v2版本会给msg指定一个"content"的key |
[cid:e1b5409f-daa4-4d48-9728-e00d60da89a0]
global:
StructureType: v2
看了下代码,要这么写才会走v2版本,奇怪.. ,因为我当时在v1版已经改了一波,就没研究v2了.
而且v2的数据格式也不一样了,长这样, [cid:6c5c3f42-357a-4b14-95ae-075b3d41781d]
其中的aaaa 是kafka中的原始内容.
…________________________________
发件人: ZLfen ***@***.***>
发送时间: 2024年9月11日 12:39
收件人: alibaba/ilogtail ***@***.***>
抄送: silentmoon ***@***.***>; Author ***@***.***>
主题: Re: [alibaba/ilogtail] [BUG]: 从kafka采集后写入es异常. (Issue #1748)
您好,可以看看您这边最后成功的消费kafka推送到es的ilogtail采集配置文件吗?我也遇到这个问题,试着使用version:v2的配置还是出现该情况,{
"contents": {
"": "{"content":"test1235","host.name":"biyi-03.novalocal","ip":"192.168.82.109","log.file.path":"/home/remotesudo/ilogtail-2.0.7/AIOPS_LOG_TOPIC_ILOGTAIL_2.log","time":1726029350}"
},
"tags": {
"host.ip": "192.168.82.109",
"host.name": "biyi-03.novalocal"
},
"time": 1726029352
}
―
Reply to this email directly, view it on GitHub<#1748 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACGIVEQYVC3TSQE3J3I26SDZV7CRPAVCNFSM6AAAAABN6BYKSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBSGYYDMNRRGI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
您好,请问您最终是怎么解决这个消费kafka写入到es异常的问题,要是您方便的话可以看下您最终的ilogtail的采集配置吗?
…------------------ 原始邮件 ------------------
发件人: "alibaba/ilogtail" ***@***.***>;
发送时间: 2024年9月11日(星期三) 晚上7:00
***@***.***>;
***@***.******@***.***>;
主题: Re: [alibaba/ilogtail] [BUG]: 从kafka采集后写入es异常. (Issue #1748)
[cid:e1b5409f-daa4-4d48-9728-e00d60da89a0]
global:
StructureType: v2
看了下代码,要这么写才会走v2版本,奇怪.. ,因为我当时在v1版已经改了一波,就没研究v2了.
而且v2的数据格式也不一样了,长这样, [cid:6c5c3f42-357a-4b14-95ae-075b3d41781d]
其中的aaaa 是kafka中的原始内容.
________________________________
发件人: ZLfen ***@***.***>
发送时间: 2024年9月11日 12:39
收件人: alibaba/ilogtail ***@***.***>
抄送: silentmoon ***@***.***>; Author ***@***.***>
主题: Re: [alibaba/ilogtail] [BUG]: 从kafka采集后写入es异常. (Issue #1748)
您好,可以看看您这边最后成功的消费kafka推送到es的ilogtail采集配置文件吗?我也遇到这个问题,试着使用version:v2的配置还是出现该情况,{
"contents": {
"": "{"content":"test1235","host.name":"biyi-03.novalocal","ip":"192.168.82.109","log.file.path":"/home/remotesudo/ilogtail-2.0.7/AIOPS_LOG_TOPIC_ILOGTAIL_2.log","time":1726029350}"
},
"tags": {
"host.ip": "192.168.82.109",
"host.name": "biyi-03.novalocal"
},
"time": 1726029352
}
―
Reply to this email directly, view it on GitHub<#1748 (comment);, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACGIVEQYVC3TSQE3J3I26SDZV7CRPAVCNFSM6AAAAABN6BYKSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBSGYYDMNRRGI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
👍🏻可以把代码整理下提交个pr |
好的 |
奇怪,意思是service_kafka 插件实现了input 的v2接口, 但flusher_kafka_v2插件又没有实现flush的v2接口, |
感觉还只能用v1, 看起来是flusher_kafka_v2插件没有实现flush的v2接口,所以才会报这个错 |
谢谢哈,我试试改v1改代码的方式 |
v2还没完全实现全,有兴趣的话可以一起参与加速下 |
难怪, 等有空过去瞧瞧, 哈哈. |
Describe the bug
A clear and concise description of what the bug is, ideally within 20 words.
iLogtail Running Environment
Please provide the following information:
ilogtail version:
2.0.7
Yaml configuration:
enable: true
inputs:
Type: service_kafka
Brokers:
version: 1.0.0
Topics:
ConsumerGroup: ****
ClientID: ****
flushers:
Type: flusher_stdout
FileName: stdout.txt
Type: flusher_elasticsearch
Addresses:
Index: ****
Authentication:
PlainText:
Username: ***
Password: ***
ilogtail.LOG:
logtail_plugin.LOG:
原始日志已经找不到了, 大致情况是这样子,
如果直接从文件采集,得到的日志格式是如图中的1,
如果从kafka采集,日志格式就变成了2那样, 本来应该为content的key名变成了空字符串, 导致写不进es, 简单改下代码让空字符串变成"content",就可以成功写入.
The text was updated successfully, but these errors were encountered: