fangli / fluent-plugin-influxdb

A buffered output plugin for fluentd and InfluxDB
MIT License
111 stars 65 forks source link

[ Feature Request ] wildcards support for tag_keys #98

Open ash0080 opened 5 years ago

ash0080 commented 5 years ago

Practically, json format data will be flattened before sending to influxdb , example:

//  product log
{
    path: 'xxxxxxxx',

    product:
    {
        id: 'xxx',
        'name': 'xxx'
    }
    message: 'xxxx'
}

// task log
{
    path: 'xxxxxxxx',
    task:
    {
        id: 'xxx',
        user:
        {
            id: 'xxx',
            nickname: 'xxx'
        },
        product:
        {
            id: 'xxx',
            'name': 'xxx'
        }
    },
    message: 'xxxx'
}

logger.emit('info', flatten(obj))

if I want to mark all id as tags I have to set tag_keys = [ 'product.id', 'task.user.id', 'task.product.id' ]

With more nested data structure, I have to mark more stupid chained key name manually

so could we add feature support wildcards **.id as fluent <match> pattern or regex format /$id/

???