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
[WIP] Output clickhouse #132
Conversation
queryString := fmt.Sprintf("INSERT INTO %s FORMAT JSONEachRow", t.TargetTable) | ||
requestURL := fmt.Sprintf("%s?query=%s", t.DSN, url.QueryEscape(queryString)) | ||
|
||
request, _ := http.NewRequest("POST", requestURL, strings.NewReader(string(newEventAsJSON))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not ignore any errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing, will do.
for _, key := range t.Fields { | ||
fieldValue, exists := event.GetValue(key) | ||
|
||
if true == exists { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if true == exists { | |
if exists { |
"context" | ||
"fmt" | ||
"io/ioutil" | ||
"log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try github.com/tsaikd/gogstash/config/goglog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see not all plugins use it but if it's the desired one I will implement it.
} | ||
|
||
if resp.StatusCode != 200 { | ||
defer resp.Body.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The client must close the response body when finished with it
Does the pester
HTTP client has different behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and I want to implement it. It mostly handles retries, which reduces the possibility of missed documents. I want users to be able to customise it as they do for elastic plugin.
I addition, I want to implement batch processing since ClickHouse prefers it |
Hi, is there a plan to merge? |
I don't see any actions after the last review. |
I won't proceed with this draft since I'm currently using another solution that already has ClickHouse output option. |
Hi, this is still work in progress (features, docs and tests still missing) but basic functionality is there.
Do you think you can have a look at it and let me know if I'm totally misguided or if you see this as a possible merge in the future?
Thanks in advance