22-07-20 02:34 PM
Hi Community
Any idea how I can create a DateTime dt = "YYYYMMdd_HHmm" that is round down to 10 minutes?
We need to configure DataGateways in a way that the file is written new every 10 Minutes. I'd like to do this by using the given DateTime functionality.
How can I round down the datetime i'm using in the file name = dgwlog_%{+YYYYMMdd_HHmm}.txt to 10 minutes?
Meaning:
20200721_1042 --> 20200721_1040
20200721_1048 --> 20200721_1040
20200721_1050 --> 20200721_1050
The goal is that there will be a new file every 10 minutes for the DataGateways output.
If I am using only one Minute value like "log_%{+YYYYMMdd_HHm}0.txt" --> this will give me Minutes like this: 1 or 17 or 53.
So this is not working.
Thank you in Advance
Answered! Go to Answer.
29-07-20 03:18 PM
Hi Yves,
If you can have the Data Gateways input run once every 10 minutes then you could use the Custom Configuration to modify the schedule to execute every 10 minutes so that a file will be created at minutes 00,10,20,30,40,50 every hour. The schedule is in a Cron format so the schedule line for the input would be;
schedule => "*/10 * * * * *"
This way you could keep your file suffix format of YYYYMMdd_HHmm.
Please be aware that once you use the Custom Configuration for a Data Gateways Configuration, you cannot go back to using the GUI based configuration and as always I suggest testing this in a lower environment (local machine, development, test) before making changes in production.
Regards
Chris
27-07-20 06:26 PM
28-07-20 06:55 AM
29-07-20 03:18 PM
Hi Yves,
If you can have the Data Gateways input run once every 10 minutes then you could use the Custom Configuration to modify the schedule to execute every 10 minutes so that a file will be created at minutes 00,10,20,30,40,50 every hour. The schedule is in a Cron format so the schedule line for the input would be;
schedule => "*/10 * * * * *"
This way you could keep your file suffix format of YYYYMMdd_HHmm.
Please be aware that once you use the Custom Configuration for a Data Gateways Configuration, you cannot go back to using the GUI based configuration and as always I suggest testing this in a lower environment (local machine, development, test) before making changes in production.
Regards
Chris