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

[BUG]: Plugin Clickhouse Flusher: back-slash lost when writing data contains '\' #1223

Closed
BetaCat0 opened this issue Nov 7, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@BetaCat0
Copy link

BetaCat0 commented Nov 7, 2023

Describe the bug
Plugin flusher Clickhouse:
Back-slash lost when writing data contains \

iLogtail Running Environment
Please provide the following information:

  • ilogtail version:
    1.8.0
  • Yaml configuration:
    NaN
  • ilogtail.LOG:
    NaN
  • logtail_plugin.LOG:
    NaN
@BetaCat0 BetaCat0 added the bug Something isn't working label Nov 7, 2023
@BetaCat0
Copy link
Author

BetaCat0 commented Nov 7, 2023

I noticed that the allocated JSON data becomes invalid after being sent back to ClickHouse. The code provided below constructs SQL without escaping special characters, as indicated in the ClickHouse official documentation. It appears that there might be a workaround by escaping these characters before sending them. However, I am uncertain if this is the correct approach to resolving the issue.

@starriesWEB
Copy link

这个不是 flusher 的 bug,是 ck 的问题
比如:插入时是 \",入库时就是 "
我前几天遇到的问题也是,导致 ck 的 json 函数报错,所以直接改源码,改成合适自己的业务
https://github.com/starriesWEB/ilogtail#change

@BetaCat0
Copy link
Author

这个不是 flusher 的 bug,是 ck 的问题 比如:插入时是 \",入库时就是 " 我前几天遇到的问题也是,导致 ck 的 json 函数报错,所以直接改源码,改成合适自己的业务 https://github.com/starriesWEB/ilogtail#change

好的,感谢~

@linrunqi08
Copy link
Collaborator

@BetaCat0 @starriesWEB 方便的话可以留一下使用场景,万分感谢🙏:#693

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants