DataDog / fluent-plugin-datadog

Fluentd output plugin for Datadog: https://www.datadog.com
Apache License 2.0
39 stars 26 forks source link

Support providing "service" and "source" metadata #3

Closed rootd00d closed 6 years ago

rootd00d commented 6 years ago

Describe what happened:

Describe what you expected: A flexible means of labeling the service and log source in fluentd configuration

image

rootd00d commented 6 years ago

Apparently, I just need to read the FAQs: https://docs.datadoghq.com/logs/faq/how-to-send-logs-to-datadog-via-external-log-shippers/#fluentd

In the end, we used the record_transformer plugin to do something like this to add the required metadata in Fluentd --

<filter filtered.**>
    @type record_transformer
    <record>
        message ${record["log"]}
        ddsource "${tag_parts[4]}"
        syslog.hostname "${hostname}"
        syslog.appname "${tag_parts[4]}"
    </record>
    remove_keys log
</filter>