Postman data into http_poller method

Hi all,

We are working on fetching data from a monitoring tool into elastic search, the integration is possible through postman wherein i'll pass user credentials and a service tag to get the output.

Is there a way in logstash where i can pass on this information and get the output in elasticsearch.
I knew we can pass user credentials in http_poller method, but for passing an additional input is there a way?

Thanks
Gauti

What kind of "additional input"? What does the request you need to make look like?

@magnusbaeck It is just a plain text, as soon as the config file hits the url it'll prompt for some input, so i had to pass those input values (for e.g. if i need to fetch data for servers i have to pass on server name)

the usual input of http poller config file is
it hits the url first,
then prompts for user credentilas
then it passes on to the filters and output.

In my scenario after password i need to pass the input value (like: {"scop":"ServiceTag","scopvalue":"LAPTOP"}

Is there any possible way? please advice.

Thanks
Gauti

Sorry, I don't understand what you're trying to do and in what way the http_poller input comes up short. Are you describing the desired behavior of the input plugin (i.e. that it should prompt you for input)? That's not supported.

How do you pass that input? Is it the request body on a POST?

yeah @Badger it is in the request body.

Thanks
Gauti

I believe the http_poller input and the http_client mixin are wrappers around the manticore http client.

The plugin does not support it, but it could be modified to pass 'query' as part of the configuration to the manticore client, which it would use as a request body for a post. You would have to modify the code and build your own version of the client.

Thanks @Badger but that looks complicated, the other way what i'm thinking is when i do a curl i'm able to pass on the inputs and able to get the output what i'm expecting, is there a way where i can use curl to get this done?
If yes, can u please guide me.

Thanks
Gauti

You might be able to get it working using an exec input that runs curl and reads the body from a file.

input { exec { command => "curl ... < body.txt" ... } }

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