Skip to content

Custom request headers not working #144

@jasonfy2k

Description

@jasonfy2k

Logstash information:

  1. Logstash version (e.g. bin/logstash --version): 8.7.0
  2. Logstash installation source (e.g. built from source, with a package manager: DEB/RPM, expanded from tar or zip archive, docker): DEB
  3. How is Logstash being run (e.g. as a service/service manager: systemd, upstart, etc. Via command line, docker/kubernetes): Docker container
  4. How was the Logstash Plugin installed: Bundled

JVM (e.g. java -version): Bundled - Temurin-17.0.6+10

OS version (uname -a if on a Unix-like system): Ubuntu 20.04

Description of the problem including expected versus actual behavior:
Config is below, I can't seem to get the headers to work. I've tried varying syntaxes as I saw another bug report in the repo where the user enclosed all headers except the first within double quotes and that worked, but no luck. I can see that the endpoint gets the request, but the User-Agent header is set as Manticore 0.9.1, and not the custom header I have set.

I'm following the documentation found here.

input {
  http_poller {
    urls => {
      "dev" => {
        method => get
        url => "$url"
        headers => {
          Accept => "application/json"
          User-Agent => "Platform"
        }
    }
    request_timeout => 180
    socket_timeout => 180
    schedule => { every => "1m"}
    codec => "json"
    metadata_target => "http_poller_metadata"
  }
}

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions