-
Notifications
You must be signed in to change notification settings - Fork 183
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
remove log_format, attach fields by default #232
Conversation
if annotations["sumologic.com/sourceHost"].nil? | ||
sumo_metadata[:host] = sumo_metadata[:host] % k8s_metadata | ||
else | ||
sumo_metadata[:host] = annotations["sumologic.com/sourceHost"] % k8s_metadata |
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.
what does %
mean here?
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.
good question - for default source name, we use something like %{namespace}.%{pod}.%{container}
, so if k8s_metadata
contains keys for namespace
, pod
, or container
, it will populate those values so we get a final source name like sumologic.fluentd-xxx.fluentd
or something like that
I believe this was how we supported dynamically populating metadata values in our sumo metadata.
# message ${begin; record["message"].merge(JSON.parse(record["message"]["log"])).delete("log"); rescue JSON::ParserError; record["message"]; end} | ||
# </record> | ||
# </filter> | ||
<match containers.**> |
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.
did we want to add before and after examples for each filter here?
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.
good catch, will do that
2617b69
to
30ee4c3
Compare
* Add WAF collector * Fmt * Add role and S3 source * Module role
Description
I recommend reviewing commit by commit (maybe also with "hide whitespace changes"), hopefully that makes it easier to read the changes
By removing the
log_format
config, the filter plugin now always attaches the metadata as_sumo_metadata.fields
.We did get rid of
add_timestamp
in the output plugin, so the logs that come in no longer havetimestamp
(but still havetime
). We'll have to explicitly decide what we want to do by default to make those config changes in the fluentd yaml.TODO: use
sumologic
output plugin version2.0.0
in DockerFile when gem is released, once SumoLogic/fluentd-output-sumologic#53 is mergedTesting performed
sumologic
output plugin to verify behaviour