Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Custom request headers not working #144

Open
jasonfy2k opened this issue May 13, 2024 · 0 comments
Open

Custom request headers not working #144

jasonfy2k opened this issue May 13, 2024 · 0 comments
Labels

Comments

@jasonfy2k
Copy link

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

@jasonfy2k jasonfy2k added the bug label May 13, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant