Skip to main content
Justinh_klik
Silver ⭐️
December 5, 2025
Solved

NiFi EnvokeHTTP - putting current date on HTTP URL property

I need to pull data from pager duty that needs a date in the url.  This is an example:

https://api.pagerduty.com/oncalls?include%5B%5D=users&schedule_ids%5B%5D=AAAAAA&schedule_ids%5B%5D=BBBBBB&schedule_ids%5B%5D=CCCCCC&schedule_ids%5B%5D=DDDDDD&since=2025-12-04&until=2025-12-05&earliest=true

The two parameters are since and until.  The intent is this runs once a day and a new date value set for each day.  Something tells me it may look like this:


https://api.pagerduty.com/oncalls?include%5B%5D=users&schedule_ids%5B%5D=AAAAAA&schedule_ids%5B%5D=BBBBBB&schedule_ids%5B%5D=CCCCCC&schedule_ids%5B%5D=DDDDDD&since=#{since_date}&until=#{until_date}&earliest=true

 

but the how I don't know.  I'll continue searching, but if anyone has a solution I will be thankful.

MattWho
MattWhoAnswer
Titanium ⭐️⭐️⭐️
December 5, 2025

@Justinh_klik 

Welcome to the community!

Unfortunately, both the url you shared are truncated and I am unable to see what you are attempting.

My initial thought would be to use a GenerateFlowFile processor sceduled based on a cron to run daily.   You can use NiFi Expression Language (NEL) to dynamically define Attributes on the FlowFile each time GenerateFlowFile is scheduled to execute for "since" and "until"  date strings you need to use in the URL used by the InvokeHTTP processor.

The GenerateFlowFile  processor passes this daily generated FlowFile to the InvokeHTTP processor trigger its daily execution.   The "HTTP URL" property in the InvokeHTTP processor also support NEL.   Something like the following:

https://api.pagerduty.com/oncalls?since=${since}&until=${until}&users&Schedule_ids...

${since} and ${until} within above URL would get replaced with the values assigned to the FlowFile attributes "since" and "until" that exist in the FlowFile being passed to the InvokeHTTP processor.

 

Please help our community grow. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt

2 replies

MattWho
Titanium ⭐️⭐️⭐️
MattWhoAnswer
Titanium ⭐️⭐️⭐️
December 5, 2025

@Justinh_klik 

Welcome to the community!

Unfortunately, both the url you shared are truncated and I am unable to see what you are attempting.

My initial thought would be to use a GenerateFlowFile processor sceduled based on a cron to run daily.   You can use NiFi Expression Language (NEL) to dynamically define Attributes on the FlowFile each time GenerateFlowFile is scheduled to execute for "since" and "until"  date strings you need to use in the URL used by the InvokeHTTP processor.

The GenerateFlowFile  processor passes this daily generated FlowFile to the InvokeHTTP processor trigger its daily execution.   The "HTTP URL" property in the InvokeHTTP processor also support NEL.   Something like the following:

https://api.pagerduty.com/oncalls?since=${since}&until=${until}&users&Schedule_ids...

${since} and ${until} within above URL would get replaced with the values assigned to the FlowFile attributes "since" and "until" that exist in the FlowFile being passed to the InvokeHTTP processor.

 

Please help our community grow. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt

Translate
Justinh_klik
Silver ⭐️
December 9, 2025

Matt,

After some digging I found that I could use an updateattribute processor.  In it I create two custom attributes:

since_date
${now():format("yyyy-MM-dd")}

since_date_1
${now():toNumber():minus(86400000):format("yyyy-MM-dd")}

Then later in the InvokeHTTP processor I can use the custom attributes in the url line:

... &since=${since_date}&until=${until_date}&earliest=true

Even later I then learned those attributes can be created in the GenerateFlowfile processor or used directly in the url as the formula:

${now():format("yyyy-MM-dd")}

which is along the lines of what you posted.  Thank you for the response.

Translate