-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add kafka backend #1
Conversation
* added required configuration definition to allow setting up a kafka logger * added a logger backend to send the agents logs to kafka * updated the docker-compose to allow to run different backends
@@ -12,7 +12,7 @@ import ( | |||
|
|||
const ( | |||
// DBString to format connection string to database for postgres | |||
DBString = "host=%s port=%s dbname=%s user=%s password=%s sslmode=disable" | |||
DBString = "host=%s port=%s dbname=%s user=%s password=%s sslmode=require" |
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 will revert this line before creating PR against upstream, it's needed for our tests
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'm making some changes to make this configurable!
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.
We don't need this db change as the author already added them
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.
oh maaaaan!
This reverts commit f58a5f4.
|
||
OSCTRL_TLS_LOGGER=db | ||
|
||
LOG_KAFKA_BOOTSTRAP_SERVERS=my-kafka-bootstrap-server |
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.
Need be disabled by default for these config and add more comments for it
@@ -54,6 +54,15 @@ services: | |||
- DB_PASS=${POSTGRES_DB_PASSWORD} | |||
#### Redis settings #### | |||
- REDIS_HOST=osctrl-redis | |||
#### Kafka settings #### | |||
- LOG_KAFKA_BOOTSTRAP_SERVERS=${LOG_KAFKA_BOOTSTRAP_SERVERS} |
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.
Same here, it should be disabled by default.
"failed to produce message to kafka topic '%s'. details: %s", l.config.Topic, err) | ||
} | ||
if debug { | ||
log.Printf("message with key '%s' was sent to topic '%s' successfully\n%s", key, l.config.Topic, string(data)) |
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 think they updated the log for the application, try to merge with the upstream
This PR will make it possible for osctrl to send the osquery-agent logs to a kafka topic. this means that these logs will no longer be pushed to the database, you need to set kafka as the log backend at init time otherwise it will log into database.