{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"HTTPプロトコルを介したログ収集のためのTD Agent","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":"httpプロトコルを介したログ収集のためのtd-agent","__idx":0},"children":["HTTPプロトコルを介したログ収集のためのTD Agent"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HTTPを使用して、多くの場所からTreasure Agent(td-agent)にログを追加できます。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/td-agent/td-agent-collecting-logs-through-an-http-protocol#prerequisites"},"children":["前提条件"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/td-agent/td-agent-collecting-logs-through-an-http-protocol#configuration"},"children":["設定"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/integration-hub/streaming/td-agent/td-agent-collecting-logs-through-an-http-protocol#uploading-data-via-http"},"children":["HTTP経由でのデータアップロード"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"前提条件","__idx":1},"children":["前提条件"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/tools/cli-and-sdks/quickstart"},"children":["TD Toolbelt"]},"を含むTreasure Dataの基本的な知識。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"設定","__idx":2},"children":["設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["_/etc/td-agent/td-agent.conf_ファイルに以下の行を追加してください。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"conf","header":{"controls":{"copy":{}}},"source":"# HTTP input\n<source>\n  type http\n  port 8888\n</source>\n\n# Treasure Data output\n<match td.*.*>\n  type tdlog\n  endpoint api.treasuredata.com\n  apikey ...\n  auto_create_table\n  buffer_type file\n  buffer_path /var/log/td-agent/buffer/td\n  use_ssl true\n</match>\n","lang":"conf"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"http経由でのデータアップロード","__idx":3},"children":["HTTP経由でのデータアップロード"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["JSONデータを送信することで、HTTP経由でログを追加できます。POSTメソッドを使用し、URLでdatabaseとtable名を指定してください。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ curl -X POST -d 'json={\"action\":\"login\",\"user\":2}' \\\nhttp://localhost:8888/td.testdb.www_access\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td-agentは毎分継続的にログをアップロードします。SIGUSR1シグナルを送信すると、バッファがフラッシュされます。アップロードは即座に開始されます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"kill -USR1 `cat /var/run/td-agent/td-agent.pid`\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データが正常にアップロードされたことを確認するには、以下のように_td tables_コマンドを実行してください。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td tables\n+------------+------------+------+-----------+\n| Database   | Table      | Type | Count     |\n+------------+------------+------+-----------+\n| testdb     | www_access | log  | 1         |\n+------------+------------+------+-----------+\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["問題が発生した場合は、ログ(/var/log/td-agent.log)がトラブルシューティングの開始点として適しています。"]}]},"headings":[{"value":"HTTPプロトコルを介したログ収集のためのTD Agent","id":"httpプロトコルを介したログ収集のためのtd-agent","depth":1},{"value":"前提条件","id":"前提条件","depth":1},{"value":"設定","id":"設定","depth":1},{"value":"HTTP経由でのデータアップロード","id":"http経由でのデータアップロード","depth":1}],"frontmatter":{"seo":{"title":"HTTPプロトコルを介したログ収集のためのTD Agent"}},"lastModified":"2026-02-17T05:21:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/products/customer-data-platform/integration-hub/streaming/td-agent/td-agent-collecting-logs-through-an-http-protocol","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}