Description
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 valueValue_A
, butX-Key-B
would have the valueabc
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.