I've a token generated by a shell script and stored in a file(api_calls.log)). I wanted the logstash config file to read the file and use the token in the request in http_poller.  The token has to be used in Authorization  => "Bearer %{token}"

Really appreciate if any body can help in this regard. Below is the config file.

input
{
file {
    path => "/home/gmanoharan155/Tool/logstash-5.5.1/api_calls.log"
        start_position => "beginning"
     }
http_poller{
urls => {
test2 => {
method => get
url => "https://xyz.co.uk/pa/1/testRuns?jobTemplate=jobTemplates/66620"
headers => {
Authorization  => "Bearer %{token}"
Realm  => "626367"
}
}
}
request_timeout => 1200
interval => 1200
codec => json
}
}
filter {
 
 split {
   field => "results"
 }
}

output {
    stdout { }
file {
   path => "/home/gmanoharan155/Tool/logstash-5.5.1/output.log"

}

}

---
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB