Dynamic time variables

You can use dynamic time variables to include timestamps in folder paths, names and log filenames in DataStream 2. This helps you sort logs in the destinations where your stream sends and stores logs, such as Amazon S3 and Microsoft Azure Storage.

Dynamic variables

Use {} to enter a dynamic variable in folder paths and upload file prefixes. You can use these variables:
  • %Y for a year. For example, 2025.
  • %m for a month (01-12). For example, 03.
  • %d for a day (01-31). For example, 13.
  • %H for an hour (00-23). For example, 15.

Folder path variables

You can combine static values and dynamic variables in a string of up to 255 characters in the Folder path fields to point to the folder path where you want to store logs. On sending a log file to this path, the system resolves dynamic variables into the current date, time, and hour in the UTC standard. Multiple dynamic variables separated by /within one {} create separate folders. For example, {%Y/%m/%d/} creates this path consisting of three folders: 2020/10/05. Multiple variables joined without a separator create one folder. For example, {%Y}{%m}{%d} creates the 20201005 folder.

Path folder examplesHere are examples of valid paths in destination configurations and the resulting folder paths in target destinations.
Path in configuration Path in destination
logs/{%Y/%m/%d} logs/2022/10/27
{%m}-logs/diagnostics 05-logs/diagnostics
diagnostics/{%Y}/{%m}/{%d}{%H} diagnostics/2022/11/0516

Log file variables

Log files that the system uploads to your destination follow this naming pattern: <uploadFilePrefix>-{random-string}-{epoch-timestamp}-{random-string}-<uploadFileSuffix>. You can customize the <uploadFilePrefix> and <uploadFileSuffix> values of these files.

You can use static values and dynamic variables in a string of up to 200 characters in <uploadFilePrefix> names of log files that you upload to destinations. On sending a log file, the system resolves dynamic variables into the current date, time, and hour. You can use multiple dynamic values separated by -, _, or no separator. Filename prefixes don't allow . characters, as using them may result in errors and data loss. If unspecified, the <uploadFilePrefix> value defaults to ak.

You can use static values in a string of up to 10 characters in <uploadFileSuffix> names of log files that you upload to destinations. Filename suffixes don't allow dynamic values, and ., /,%, and ? characters, as using them may result in errors and data loss. If unspecified, the<uploadFileSuffix> value defaults to ds.

File names examplesHere are examples of log filenames with custom prefixes and suffixes.
Prefix Suffix File name
{%Y}-{%m}-{%d} akam 2022-10-27-rps79rkvx-1666884947-dkmzsi6z8-akam
diagnostics{%Y-%m-%d} logs diagnostics2022-12-01-8ds3lufkh-1669908947-m1onxoa16-logs
{%m}-diagnostics delivery 12-diagnostics-dk4j0sh3m-1669856400-9kv08v9oy-delivery
upload-{%m_%d_%H}-file data upload-04_23_18-file-gao0pip6y-1650736800-981bz2ipd-data
Unspecified (ak by default) Unspecified (ds by default) ak-ae47rr5a8-1650736800-ae47rg6hu-ds