Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

http-poller plugin add_field doesn't work #6773 #77

Open
jsvd opened this issue Aug 4, 2017 · 1 comment
Open

http-poller plugin add_field doesn't work #6773 #77

jsvd opened this issue Aug 4, 2017 · 1 comment

Comments

@jsvd
Copy link
Member

jsvd commented Aug 4, 2017

migrated from elastic/logstash#6773


When using 'add_field' in the http_poller input plugin of a Logstash configuration, the field is lost when the plugin returns an error on the test URL.

See example input block below. The Links LINK_1 and LINK_3 for example may return a success (http 200) and the added field 'environment' will be part of the resulting document.
But in a case were LINK_2_DOWN and LINK_3_UNREACHABLE return an error response (http <> 200) then the added field 'environment' is NOT part of the result document.

  • Version: 2.4.x, 5.x
  • Operating System: Linux
  • Config File: (input block of the Logstash configuration file)
    input {
    # ITT Polling.
    http_poller {
    urls => {
    LINK_1 => "http://xxx-it.html"
    LINK_2_DOWN => "http://xxx-down.html"
    }
    request_timeout => 10
    interval => 300
    codec => plain
    metadata_target => "http_poller_metadata"
    add_field => { "environment" => "I" }
    }
    # UAT Polling.
    http_poller {
    urls => {
    LINK_3 => "http://xxx-uat.html"
    LINK_4_UNREACHABLE => "http://xxx-unreachable.html"
    }
    request_timeout => 10
    interval => 300
    codec => plain
    metadata_target => "http_poller_metadata"
    add_field => { "environment" => "A" }
    }
    }
@Benny-Git
Copy link

I just wanted to open a similar Issue and found this existing one.
I hit this issue with Logstash 6.6 this weekend, when our Healthcheck failed with a timeout, and then didn't include the metadata I needed.
I will try to include the add_field in a mutate filter as a workaround for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants