Hello,
I have a logstash confg with uses http poller. The big problem I have is that, I need the current date sent in the body so the API knows what data to return. It doesn't work with relative dates, it needs the exact date to query.
So, I have tried many different ways to put the current server date in the body field of the request within the logstash.conf. Here is an example:
input{
http_poller {
#proxy => { host => "" }
proxy => ""
urls => {
q1 => {
method => post
url => ""
headers => {.... }
body => '{
"rsid": "....",
"globalFilters": [
{
"type": "dateRange",
"dateRange": "%{+ddMMyyHHmmss}"
}
................
}'
}
}
request_timeout => 60
# Supports "cron", "every", "at" and "in" schedules by rufus scheduler
schedule => { cron => "* * * * * UTC"}
codec => "json"
metadata_target => "http_poller_metadata"
}
}
output {
elasticsearch {
hosts => ["xxxx"]
index => "xxxx"
}
}
In every example I try, it just sends the raw value "%{+ddMMyyHHmmss}" and doesn't turn it into the current date. Any help would be really appreciated, I have done extensive searching but cant find the answer.