{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Adobe Analytics Import Integration Using CLI","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"adobe-analytics-import-integration-using-cli","__idx":0},"children":["Adobe Analytics Import Integration Using CLI"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can also use the FTP data connector from the command line interface. The following instructions show you how to import data using the CLI."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"install-td-command-v0119-or-later","__idx":1},"children":["Install 'td' command v0.11.9 or later"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Install the most current ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/"},"children":["Treasure Data Toolbelt"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td --version\n0.11.10\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-seed-config-file-seedyml","__idx":2},"children":["Create Seed Config File (seed.yml)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Prepare seed.yml as shown in the following example, with your Adobe Analytics' SFTP details. We support two authentication methods: Public / Private Key Pair, and Password."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"case-1-public--private-key-pair-authentication","__idx":3},"children":["Case 1: Public / Private Key Pair Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create seed.yml with the following content."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: adobe_analytics\n  host: HOST\n  port: <PORT, default is 22>\n  user: USER\n  secret_key_file:\n    content: |\n      -----BEGIN RSA PRIVATE KEY-----\n      Proc-Type: 4,ENCRYPTED\n      DEK-Info: AES-128-CBC...\n      ...\n      -----END RSA PRIVATE KEY-----\n  secret_key_passphrase: PASSPHRASE\n  user_directory_is_root: true\n  timeout: 600\n  path_prefix: /path/to/sample\nout:\n  mode: append\n  exec: {}\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["secret_key_file"]}," requires OpenSSH format."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"case-2-password-authentication","__idx":4},"children":["Case 2: Password Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create seed.yml with the following content."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: adobe_analytics\n  host: HOST\n  port: <PORT, default is 22>\n  auth_method: password\n  user: USER\n  password: PASSWORD\n  user_directory_is_root: true\n  timeout: 600\n  path_prefix: /path/to/sample\nout:\n  mode: append\n  exec: {}\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use the following special characters in the password: \"#$!*@\""]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you are using the proxy, add the additional information as shown:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: adobe_analytics\n  host: HOST\n  port: <PORT, default is 22>\n  ....\n  proxy:\n    type: http\n    host: PROXY_HOST\n    port: PROXY_PORT\n    user: PROXY_USER\n    password: PROXY_PASSWORD\n    command: SOMETHING COMMAND IF NEEDED\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Data Connector forAdobe Analytics imports all files that match the specified prefix (e.g. path_prefix: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["path/to/sample_"]}," –> ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["path/to/sample_201501.csv.gz"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["path/to/sample_201502.csv.gz"]},", …, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["path/to/sample_201505.csv.gz"]},")."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more details on available out modes, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/int/adobe-analytics-import-integration-using-cli#h1__1835053169"},"children":["Appendix"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"guess-fields-generate-loadyml","__idx":5},"children":["Guess Fields (Generate load.yml)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use connector:guess. This command automatically reads the source file, and assesses (uses logic to guess) the file format."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td connector:guess seed.yml -o load.yml\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you open load.yml, you'll see the guessed file format definitions including file formats, encodings, column names, and types. This example is trying to load csv files."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: adobe_analytics\n  host: HOST\n  port: <PORT, default is 22>\n  user: USER\n  secret_key_file:\n    content: |\n      -----BEGIN RSA PRIVATE KEY-----\n      Proc-Type: 4,ENCRYPTED\n      DEK-Info: AES-128-CBC...\n      ...\n      -----END RSA PRIVATE KEY-----\n  secret_key_passphrase: PASSPHRASE\n  user_directory_is_root: true\n  timeout: 600\n  path_prefix: /path/to/sample\n  parser:\n    skip_header_lines: 1\n    charset: UTF-8\n    newline: CRLF\n    type: csv\n    delimiter: ','\n    quote: '\"'\n    columns:\n    - {name: id, type: long}\n    - {name: account, type: long}\n    - {name: time, type: timestamp, format: \"%Y-%m-%d %H:%M:%S\"}\n    - {name: purchase, type: timestamp, format: \"%Y%m%d\"}\n    - {name: comment, type: string}\n    - {name: json_column, type: json}\nout:\n  mode: append\n  exec: {}\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then, you can preview how the system will parse the file by using the preview command."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td connector:preview load.yml\n+-------+---------+----------+---------------------+\n| id    | company | customer | created_at          |\n+-------+---------+----------+---------------------+\n| 11200 | AA Inc. |    David | 2015-03-31 06:12:37 |\n| 20313 | BB Imc. |      Tom | 2015-04-01 01:00:07 |\n| 32132 | CC Inc. | Fernando | 2015-04-01 10:33:41 |\n| 40133 | DD Inc. |    Cesar | 2015-04-02 05:12:32 |\n| 93133 | EE Inc. |     Jake | 2015-04-02 14:11:13 |\n+-------+---------+----------+---------------------+\n"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The guess command needs over 3 rows and 2 columns in source data file, because it guesses column definition using sample rows from source data."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the system detects your column name or column type unexpectedly, modify load.yml directly and preview again."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Currently, the Data Connector supports parsing of “boolean”, “long”, “double”, “string”, and “timestamp” types."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You also must create a local database and table prior to executing the data load job. Follow these steps:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td database:create td_sample_db\ntd table:create td_sample_db td_sample_table\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"execute-load-job","__idx":6},"children":["Execute Load Job"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Submit the load job. It may take a couple of hours depending on the size of the data. Specify the Treasure Data database and table where the data should be stored."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It's also recommended to specify --time-column option, because Treasure Data's storage is partitioned by time (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/data-partitioning-in-treasure-data"},"children":["data partitioning"]},") If the option is not provided, the data connector chooses the first long or timestamp column as the partitioning time. The type of the column specified by --time-column must be either of long and timestamp type."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If your data doesn't have a time column you can add a time column by using add_time filter option. For more details see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/add_time-filter-function"},"children":["add_time filter plugin"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:issue load.yml --database td_sample_db --table td_sample_table --time-column created_at\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The connector:issue command assumes that you have already created a ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["database(td_sample_db)"]}," and a ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["table(td_sample_table)"]},". If the database or the table do not exist in TD, the connector:issue command fails, so create the database and table ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/data-management"},"children":["manually"]}," or use --auto-create-table option with td connector:issue command to auto create the database and table:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:issue load.yml --database td_sample_db --table td_sample_table --time-column created_at --auto-create-table\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Data Connector does not sort records on server-side. To use time-based partitioning effectively, sort records in files beforehand."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you have a field called ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time"]},", you don't have to specify the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--time-column"]}," option."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td connector:issue load.yml --database td_sample_db --table td_sample_table\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"scheduled-execution","__idx":7},"children":["Scheduled execution"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can schedule periodic Data Connector execution for incremental Adobe Analytics' SFTP file import. We configure our scheduler carefully to ensure high availability. By using this feature, you no longer need a cron daemon on your local data center."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the scheduled import, the Data Connector for Adobe Analytics imports all files that match with the specified prefix (e.g. path_prefix: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["path/to/sample_"]}," –> ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["path/to/sample_201501.csv.gz"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["path/to/sample_201502.csv.gz"]},", …, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["path/to/sample_201505.csv.gz"]},") at first and remembers the last path (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["path/to/sample_201505.csv.gz"]},") for the next execution."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On the second and on subsequent runs, it imports only files that comes after the last path in alphabetical (lexicographic) order. (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["path/to/sample_201506.csv.gz"]},", …)"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-the-schedule","__idx":8},"children":["Create the schedule"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A new schedule can be created using the td connector:create command. The following are required: the name of the schedule, the cron-style schedule, the database and table where the data will be stored, and the Data Connector configuration file."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:create \\\n    daily_import \\\n    \"10 0 * * *\" \\\n    td_sample_db \\\n    td_sample_table \\\n    load.yml\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It's also recommended to specify the --time-column option, because Treasure Data's storage is partitioned by time (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/data-partitioning-in-treasure-data"},"children":["data partitioning"]},")"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td connector:create \\\n    daily_import \\\n    \"10 0 * * *\" \\\n    td_sample_db \\\n    td_sample_table \\\n    load.yml \\\n    --time-column created_at\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cron"]}," parameter also accepts three special options: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@hourly"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@daily"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@monthly"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By default, schedule is setup in UTC timezone. You can set the schedule in a timezone using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-t"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--timezone"]}," option. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--timezone"]}," option supports only extended timezone formats like 'Asia/Tokyo', 'America/Los_Angeles' etc. Timezone abbreviations like PST, CST are not supported and may lead to unexpected schedules."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"list-the-schedules","__idx":9},"children":["List the Schedules"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can see the list of currently scheduled entries by running the command td connector:list."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:list\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"show-the-setting-and-schedule-history","__idx":10},"children":["Show the Setting and Schedule History"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td connector:show shows the execution setting of a schedule entry."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:show daily_import\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td connector:history shows the execution history of a schedule entry. To investigate the results of each individual run, use td job jobid."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:history daily_import\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"delete-the-schedule","__idx":11},"children":["Delete the Schedule"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td connector:delete will remove the schedule."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td connector:delete daily_import\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"appendix","__idx":12},"children":["Appendix"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"modes-for-out-plugin","__idx":13},"children":["Modes for out plugin"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can specify file import mode in out section of seed.yml."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"append-default","__idx":14},"children":["append (default)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is the default mode and records are appended to the target table."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  ...\nout:\n  mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"replace-in-td-01110-and-later","__idx":15},"children":["replace (In td 0.11.10 and later)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This mode replaces data in the target table. Note that any manual schema changes made to the target table will remain intact with this mode."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  ...\nout:\n  mode: replace\n","lang":"yaml"},"children":[]}]},"headings":[{"value":"Adobe Analytics Import Integration Using CLI","id":"adobe-analytics-import-integration-using-cli","depth":1},{"value":"Install 'td' command v0.11.9 or later","id":"install-td-command-v0119-or-later","depth":2},{"value":"Create Seed Config File (seed.yml)","id":"create-seed-config-file-seedyml","depth":2},{"value":"Case 1: Public / Private Key Pair Authentication","id":"case-1-public--private-key-pair-authentication","depth":3},{"value":"Case 2: Password Authentication","id":"case-2-password-authentication","depth":3},{"value":"Guess Fields (Generate load.yml)","id":"guess-fields-generate-loadyml","depth":2},{"value":"Execute Load Job","id":"execute-load-job","depth":2},{"value":"Scheduled execution","id":"scheduled-execution","depth":2},{"value":"Create the schedule","id":"create-the-schedule","depth":3},{"value":"List the Schedules","id":"list-the-schedules","depth":3},{"value":"Show the Setting and Schedule History","id":"show-the-setting-and-schedule-history","depth":3},{"value":"Delete the Schedule","id":"delete-the-schedule","depth":3},{"value":"Appendix","id":"appendix","depth":2},{"value":"Modes for out plugin","id":"modes-for-out-plugin","depth":3},{"value":"append (default)","id":"append-default","depth":4},{"value":"replace (In td 0.11.10 and later)","id":"replace-in-td-01110-and-later","depth":4}],"frontmatter":{"seo":{"title":"Adobe Analytics Import Integration Using CLI"}},"lastModified":"2025-10-31T07:48:05.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/adobe-analytics-import-integration-using-cli","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}