Passing input values to logstash from external file


(Gautham) #1

Hi All,

I have been trying to use logstash http_poller method to fetch data from one of my source.

The plan is to pull data from a restapi source which requires an URL, user ccredentials i was able to pass these two fields in the config file itself.
For a successful data retrieval i need to pass an input value as well, when i put the values in a path i'm getting error like "Unknown setting 'path' for http_poller"

Here is my config file:

input {
http_poller {
urls => {
url => "https://pilot.nanoheal.com/DashboardAPI/api/asset/getBasicInfo"
}
request_timeout => 60
proxy => { host => "10.1.1.2" port => "9999" scheme => "http"}
user => "******"
password => "*****"
schedule => { cron => "
* * * *"}
path => ["/usr/share/logstash/bin/config/inputnanoheal.json"]
start_position => "beginning"
sincedb_path => "/dev/null"
codec => "json"
metadata_target => "http_poller_metadata"
}
}
#filter

{

split

{

field => "result"

}

#}
output {

elasticsearch {

hosts => ["10.2.1.1:9200"]

index => "snow"

}

stdout {
codec => json
}
}

inputnanoheal.json : This file has the inputs to be passed.

Any advice please.

Thanks
Gauti


(Magnus B├Ąck) #2

And inputnanoheal.json would contain the body of the HTTP request? That's not supported, see https://github.com/logstash-plugins/logstash-input-http_poller/issues/61.


(Gautham) #3

@magnusbaeck This is the input value which inputnanoheal.json has

'{"scop":"ServiceTag","scopvalue":"LAPTOP"}'

Is there any way to pass this inside the config file itself? any advice on how to proceed in this situation?

Thanks
Gauti


(Gautham) #4

hi @Rom1 have gone through you post in the below link where you succeeded running a curl command through logstash, can you please share your config file or an example of config file.

I'm got stuck in executing a curl command through logstash.

Your Post : Http_poller with kerberos / NTLM authentication

Thanks
Gauti


(Gautham) #5

Any help here please :frowning:

Thanks
Gauti


(system) #6

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