{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"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":["command line interfaceからFTP data connectorを使用することもできます。次の手順は、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":["最新の",{"$$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":["次の例に示すように、Adobe AnalyticsのSFTP詳細を使用してseed.ymlを準備します。Public / Private Key PairとPasswordの2つのauthentication methodsをサポートしています。"]},{"$$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":["次の内容でseed.ymlを作成します。"]},{"$$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"]},"は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":["次の内容でseed.ymlを作成します。"]},{"$$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":["passwordで次の特殊文字を使用できます: \"#$!*@\""]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["proxyを使用している場合は、次のように追加情報を追加します:"]},{"$$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":["Adobe AnalyticsのData Connectorは、指定されたprefixに一致するすべてのファイルをインポートします(例: 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":["利用可能なout modesの詳細については、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/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":["connector:guessを使用します。このコマンドは、source fileを自動的に読み取り、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":["load.ymlを開くと、file formats、encodings、column names、typesを含む推測されたfile format定義が表示されます。この例では、csvファイルをロードしようとしています。"]},{"$$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":["その後、previewコマンドを使用して、システムがファイルをどのように解析するかをプレビューできます。"]},{"$$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":["guessコマンドは、source dataファイルに3行以上、2カラム以上が必要です。これは、source dataのsample rowsを使用してcolumn定義を推測するためです。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["システムがcolumn nameまたはcolumn typeを予期せず検出した場合は、load.ymlを直接変更して再度プレビューします。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["現在、Data Connectorは\"boolean\"、\"long\"、\"double\"、\"string\"、\"timestamp\"タイプの解析をサポートしています。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["また、data load jobを実行する前に、local databaseとtableを作成する必要があります。次の手順に従ってください:"]},{"$$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":["load jobを送信します。データのサイズによっては数時間かかる場合があります。データを保存するTreasure Dataのdatabaseとtableを指定します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["--time-columnオプションを指定することをお勧めします。Treasure Dataのstorageは時間でパーティショニングされているためです(",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/data-partitioning-in-treasure-data"},"children":["data partitioning"]},"を参照)。オプションが指定されていない場合、data connectorは最初のlongまたはtimestamp columnをpartitioning timeとして選択します。--time-columnで指定されたcolumnのタイプは、longまたはtimestampタイプのいずれかである必要があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データにtime columnがない場合は、add_time filter optionを使用してtime columnを追加できます。詳細については、",{"$$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":["connector:issueコマンドは、*database(td_sample_db)",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["と"]},"table(td_sample_table)*がすでに作成されていることを前提としています。databaseまたはtableがTDに存在しない場合、connector:issueコマンドは失敗するため、databaseとtableを",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/data-management"},"children":["手動で"]},"作成するか、td connector:issueコマンドで--auto-create-tableオプションを使用してdatabaseと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":["Data Connectorはサーバー側でレコードをソートしません。time-basedパーティショニングを効果的に使用するには、事前にファイル内のレコードをソートしてください。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time"]},"というフィールドがある場合は、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--time-column"]},"オプションを指定する必要はありません。"]},{"$$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":["incremental Adobe AnalyticsのSFTPファイルインポートのために、定期的なData Connector実行をスケジュールできます。高可用性を確保するために、schedulerを慎重に設定しています。この機能を使用することで、ローカルdata center上でcron daemonを使用する必要がなくなります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["scheduled importの場合、Adobe AnalyticsのData Connectorは、指定されたprefixに一致するすべてのファイルを最初にインポートし(例: 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"]},")、次回の実行のためにlast path(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["path/to/sample_201505.csv.gz"]},")を記憶します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["2回目以降の実行では、アルファベット(辞書式)順でlast pathの後に来るファイルのみをインポートします。(",{"$$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":["td connector:createコマンドを使用して新しいscheduleを作成できます。次のものが必要です: scheduleの名前、cron-style schedule、データが保存されるdatabaseとtable、および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":["Treasure Dataのstorageは時間でパーティショニングされているため、--time-columnオプションを指定することをお勧めします(",{"$$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":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cron"]}," parameterは、3つの特別なオプションも受け入れます: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@hourly"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@daily"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@monthly"]},"。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["デフォルトでは、scheduleはUTC timezoneで設定されます。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-t"]},"または",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--timezone"]},"オプションを使用して、timezoneでscheduleを設定できます。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--timezone"]},"オプションは、'Asia/Tokyo'、'America/Los_Angeles'などの拡張timezone formatsのみをサポートします。PST、CSTなどのtimezone abbreviationsはサポートされておらず、予期しないschedulesにつながる可能性があります。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"list-the-schedules","__idx":9},"children":["List the Schedules"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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は、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は、schedule entryの実行履歴を表示します。各個別の実行の結果を調査するには、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は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":["seed.ymlのoutセクションでfile import modeを指定できます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"append-default","__idx":14},"children":["append (default)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["これはデフォルトのmodeで、レコードは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":["このmodeは、target tableのデータを置き換えます。このmodeでは、target tableに加えられた手動のschema変更はそのまま保持されることに注意してください。"]},{"$$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-11-12T07:49:46.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/int/adobe-analytics-import-integration-using-cli","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}