Skip to content

Allow templating headers in http sink #201

Open
@binarylogic

Description

@binarylogic

For certain services the ability to dynamically set HTTP headers based on log content is important. From a user on a related project:

I am sending Docker container logs to Sumo Logic, and would like to dynamically set log metadata based on the incoming log records. Sumo Logic's HTTP receivers accept custom source names, hosts, and categories by setting HTTP headers named X-Sumo-Name, X-Sumo-Host, X-Sumo-Category.

Describe the solution you'd like

I would like a way to set dynamically header values in the http output plugin. For example, let's say there is a record key named category. There should be a way to use this as the header value.

[1154103724, {"key1"=>12345, "category"=>"abc"}]
[sinks.sumologic]
    Name           http
    Match          *
    Host           127.0.0.1
    Port           9000
    Header         X-Key-A Value_A
    Header_record  X-Key-B category
    URI            /something

In the above configuration, the header X-Key-A would have the value Value_A, but X-Key-B would have the value abc from the record.

Additional context

Without the ability to customize the log metadata via headers, I cannot effectively sort and manage logs in Sumo Logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain: templatingAnything related to templating Vector's configuration valueshave: niceThis feature is nice to have. It is low priority.meta: good first issueAnything that is good for new contributors.sink: httpAnything `http` sink relatedtype: enhancementA value-adding code change that enhances its existing functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions