# Paths

When working with paths, we need to determine whether the path provided is a folder or absolute filename.

If the path provided ends with a "/", then we will assume that the path is a directory and include it and the original filename,&#x20;

For example:

| Source File             | Configured Path | Result                   |
| ----------------------- | --------------- | ------------------------ |
| /directory/filename.txt | /newdir/        | /newdir/filename.txt     |
| /directory/filename.txt | filename2.txt   | /directory/filename2.txt |

You can use dynamic variables in the path to compose a useful destination filename. Available variables are:

| Variable         | Example Result            | Desc                          |
| ---------------- | ------------------------- | ----------------------------- |
| {EXISTING\_NAME} | filename.txt              | Take the filename             |
| {TIMESTAMP}      | 160331234                 | A unix timestamp              |
| {YYYY}           | 2050                      | The current year              |
| {YY}             | 50                        | The current year in shorthand |
| {MM}             | 03                        | The month                     |
| {DD}             | 10                        | The day of the month          |
| {USER}           | donald                    | The user on the event         |
| {EVENT.\*}       | {EVENT.username} - donald | Any attribute on the event    |

&#x20;

An example of a dynamic path used in a copy operation:

```
{
    "type":"copy",
    "copy_to":"/processed_files/{USER}/{YY}/{MM}/{DD}/{EXISTING_FILENAME}"
}
```
