{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Fluentd 継続的データインポートインテグレーション","description":"Fluentdを使用してTreasure AIに継続的にデータをインポートする方法を解説。プラグインのインストール、設定、データアップロードの手順を詳しく説明します。","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]},"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":"fluentd-継続的データインポートインテグレーション","__idx":0},"children":["Fluentd 継続的データインポートインテグレーション"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fluentdを使用してTreasure Dataにデータを継続的にインポートできます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"http://fluentd.org/"},"children":["Fluentd"]},"は、Rubyで書かれたデーモンで、ログをJSONストリームとして収集し、ログをバッファリングし、MySQL、MongoDB、あるいは他のFluentdインスタンスなどの他のシステムにログを送信します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Agent（td-agent）ロギングデーモンにはFluentdが含まれています。しかし、多くのユーザーはRuby gemsを介してFluentdをインストールしています。既存のFluentdインストールをTreasure Dataに接続できます。詳細については、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/about-treasure-data-s-server-side-agent"},"children":["サーバーサイドエージェントとしてのtd-agent"]},"をお読みください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"前提条件","__idx":1},"children":["前提条件"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"http://fluentd.org/"},"children":["Fluentd"]},"とそのインストールに関する基本的な知識。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"fluent-plugin-tdのインストール","__idx":2},"children":["fluent-plugin-tdのインストール"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下のようにfluentdとfluent-plugin-td gemsをインストールします。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ gem install fluentd\n$ gem install fluent-plugin-td\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["設定ファイルに以下の行を追加します。fluent-plugin-tdにはtdlog出力タイプが含まれており、これはTreasure Dataにデータをアップロードするために使用されます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"# HTTP input\nsource\n  type http\n  port 8888\n</source>\n\n# TCP input\nsource\n  type forward\n  port 24224\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 /path/to/buffer/td\n  use_ssl true\n</match>\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["APIキーは、アカウントを認証するための秘密鍵です。APIキーは、Treasure コンソールのプロファイルから取得できます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"データアップロードの確認","__idx":3},"children":["データアップロードの確認"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fluentdサーバーを起動します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ ./bin/fluentd --config fluentd.conf\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HTTPを使用してJSON形式でログを追加します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ curl -X POST -d 'json={\"action\":\"login\",\"user\":2}' \\\n  http://localhost:8888/td.testdb.www_access\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fluentdは継続的にログをアップロードし、毎分データを送信します。SIGUSR1シグナルを送信すると、Fluentdはバッファリングされたログを即座にクラウドにフラッシュします。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ kill -USR1 pid_of_fluentd\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td tablesコマンドを実行して、データが正常にインポートされたことを確認します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td tables\n+------------+------------+------+-----------+\n| Database   | Table      | Type | Count     |\n+------------+------------+------+-----------+\n| testdb     | www_access | log  | 1         |\n+------------+------------+------+-----------+\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["問題が発生した場合は、Fluentdのログがトラブルシューティングの良い出発点です。"]}]},"headings":[{"value":"Fluentd 継続的データインポートインテグレーション","id":"fluentd-継続的データインポートインテグレーション","depth":1},{"value":"前提条件","id":"前提条件","depth":2},{"value":"fluent-plugin-tdのインストール","id":"fluent-plugin-tdのインストール","depth":2},{"value":"データアップロードの確認","id":"データアップロードの確認","depth":2}],"frontmatter":{"seo":{"title":"Fluentd 継続的データインポートインテグレーション","description":"Fluentdを使用してTreasure AIに継続的にデータをインポートする方法を解説。プラグインのインストール、設定、データアップロードの手順を詳しく説明します。"}},"lastModified":"2026-06-17T07:22:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/int/fluentd-continuous-data-import-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}