Call recursively an API

Hello,
Using below basic http_poller request I will obtain a .json file that contains an attribute called "id".
For each "id" I need to call other APIs, having the "id" value in the url: https://..../id.
How can I achieve that in logstash ?

input {

    http_poller {

        urls => {

            snow => {  

                method => get

                user => "..."

                password => "..."

                url => "..."

                headers => {

                    Accept => "application/json"

                }

            }

        }

    request_timeout => 60

    schedule => { cron => "*/2 * * * * UTC"}

    codec => "json"

    }

}

You can use an http filter with a sprintf reference to add the [id] value to the data sent to the API.

Thanks for the advise, Badger, having a short look seems it is exactly what I needed.
I'll try to do it sometime this week and give more details.

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