We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

SFTP Connector - How to get reports only for current date for FILES_TO_PUT

SudarshanHarsha
New Contributor
New Contributor

Hi, we are working on pushing the reports generated from saviynt to the target SFTP server, we are on version 23.7 & using the SFTP connector .we have a working JSON for FILES_TO_PUT , which does push ALL the files to target SFTP .

Below is the snip of the of FILES_TO_PUT

 [
{
"eic_src_dir":"Reports",
"target_dir":"/IAM_STG/DATALAKE_SOA_STG/",
"regex_list":["^Analytics_Summary_OIDExtractDataLake.*\\.xlsx"]
}
]

 

We only want  file from current day to be pushed ,presently the above regex array is pushing all the files .

Is their way to get only the current date files ? Even though FILES_TO_PUT is in JSON format, the "files_list" and "regex_list" objects are expecting a JSON array literal.  JSON array values can only be string, number, boolean, etc.

so when we try to use javascript within the array it reads it like a string and does not resolve the current date.

 

Is there a way to get JSON syntax which can be used to dynamically derive the JSON array containing the current date ?

I tried couple of variation of JS in the JSON , no luck . Could you please let me know if we could have a working session

 

#1

[

  {

    "eic_src_dir":"Reports",

    "target_dir":"/IAM_STG/DATALAKE_SOA_STG/",

"regex_list":["${

var now = new Date();

var fileNameRegex = 'Analytics_Summary_OIDExtractDataLake_'+now.getFullYear()+ (now.getMonth()+1)+ now.getDate()+'.*\\.xlsx';

return fileNameRegex;

}"]

}

]

 

# 2

 

[

  {

    "eic_src_dir":"Reports",

    "target_dir":"/IAM_STG/DATALAKE_SOA_STG/",

"regex_list":["${

String file = 'Analytics_Summary_OIDExtractDataLake_';

String now = new Date().toISOString().substring(0,10).replace(/-/g,"").toString() ;

String fileNameRegex = file+now+'.*\\.xlsx';

return fileNameRegex; }"]

}

]

 

# 3

 

[

  {

    "eic_src_dir":"Reports",

    "target_dir":"/IAM_STG/DATALAKE_SOA_STG/",

"regex_list":["^Analytics_Summary_OIDExtractDataLake_$\\{(new Date().toISOString().substring(0,10).replace(/-/g,''))\\}.*\\.xlsx"]

}

]

 

Thanks

Sudarshan Harsha

 

 

1 REPLY 1

DaanishJawed
Saviynt Employee
Saviynt Employee

Hi @SudarshanHarsha ,

This is not currently supported. The script will pick up all the files depending on the file list/regex list and it does not consider the date.

Please raise this as an enhancement on Ideas portal - https://ideas.saviynt.com/ideas/

Thanks.