How to reference http poller data

I have logstash rigged up for two inputs, one for beats and the other for an http poller to further enrich beats data.

How do I reference the data that comes from the http_poller input?

Here is my config for the inputs:

input {
	beats {
		port => 5044
		client_inactivity_timeout => 300
	}

http_poller {
  urls => {
    igridurl => {
      method => get
      user => "usr"
      password => "pass"
      url => "myurl"
      headers => {
        Accept => "application/json"
      }      
      }
  }
  request_timeout => 60
  schedule => {every => "3h"}
  codec => "json"
  metadata_target => "http_poller_metadata"
}

}

I have tried to add a field by using:

mutate {
 add_field => {"HTTP_DATA" => "%{[http_poller_metadata]}"}
}

But that doesn't work, I literally get a field with "%{[http_poller_metadata]}" as the value...

I see one way of getting the data is to use a elasticsearch filter within logstash. Not really what I want to do, I was expecting to reference the data like I would when I use a jdbc_static filter which references the data in memory.

I needed to actually add fields like:

fields => { "@timestamp" => "started" }

I also need to add:
result_size => 40 as the default is 1.

It adds all results as an array

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.