{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":".NET Apps Import Integration","description":".NET アプリケーションからTreasure AIへのデータインポート方法を解説。td-agentのインストール手順と設定方法を詳しく説明します。","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/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"net-apps-import-integration","__idx":0},"children":[".NET Apps Import Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Dataは、.NETアプリケーションからデータをストリーミングするために、サーバーサイドのログとイベントを収集する",{"$$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":[".NETの基本知識"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treasure Dataの基本知識"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"treasure-data-integrationのipホワイトリスト","__idx":2},"children":["Treasure Data IntegrationのIPホワイトリスト"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["セキュリティポリシーでIPホワイトリストが必要な場合は、接続を成功させるためにTreasure DataのIPアドレスを許可リストに追加する必要があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["静的IPアドレスの完全なリストは、地域別に以下のリンクからご確認ください:"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/ip-addresses-integrations-result-workers"},"children":["IP Addresses for Integrations"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["アカウントの地域が不明な場合、またはさらなる支援が必要な場合は、カスタマーサクセス担当者またはテクニカルサポートチームにお問い合わせください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"td-agentのインストール","__idx":3},"children":["td-agentのインストール"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["アプリケーションサーバーに",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td-agent"]},"をインストールします。td-agentはアプリケーションサーバー内に配置され、アプリケーションログのクラウドへのアップロードに専念します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-6-8_10-12-30.451a92ac170b44d1e67245768f9cf8c13d319eb36759632725292ab1b0ecd2a9.a677b90d.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td-agentはTCP/HTTP経由でレコードを受信し、レコードをバッファリングし、5分ごとにデータをクラウドにアップロードします。デーモンはローカルノードで実行されるため、ロギングのレイテンシーは無視できます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"td-agentのインストールオプション","__idx":4},"children":["td-agentのインストールオプション"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td-agent"]},"をインストールするには、環境に応じて以下のコマンドのいずれかを実行します。エージェントプログラムは、rpm/deb/dmgなどの各プラットフォームのパッケージ管理ソフトウェアを使用して自動的にインストールされます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"rhelcentos-567","__idx":5},"children":["RHEL/CentOS 5,6,7"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ curl -L https://toolbelt.treasuredata.com/sh/install-redhat-td-agent3.sh | sh\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ubuntu-and-debian","__idx":6},"children":["Ubuntu and Debian"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# 18.04 Bionic\n$ curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-bionic-td-agent3.sh | sh\n# 16.04 Xenial (64bit only)\n$ curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent3.sh | sh\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"eolバージョンのレガシーサポートはまだ利用可能です","__idx":7},"children":["EOLバージョンのレガシーサポートはまだ利用可能です"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"# 14.04 Trusty\n$ curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-trusty-td-agent3.sh | sh\n# 12.04 Precise\n$ curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-precise-td-agent3.sh | sh\n# Debian Stretch (64-bit only) $ curl -L https://toolbelt.treasuredata.com/sh/install-debian-stretch-td-agent3.sh | sh\n# Debian Jessie (64-bit only)\n$ curl -L https://toolbelt.treasuredata.com/sh/install-debian-jessie-td-agent3.sh | sh\n# Debian Squeeze (64-bit only)\n$ curl -L https://toolbelt.treasuredata.com/sh/install-debian-squeeze-td-agent2.sh | sh\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"amazon-linux","__idx":8},"children":["Amazon Linux"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Amazon Linux 1またはAmazon Linux 2を選択できます。",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/installing-td-agent-on-aws-linux"},"children":["Installing td-agent on AWS Linux"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"macos-x-1011","__idx":9},"children":["MacOS X 10.11+"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ open 'https://td-agent-package-browser.herokuapp.com/3/macosx/td-agent-3.1.1-0.dmg'\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["MacOS X 10.11.1（El Capitan）では、いくつかのセキュリティ変更が導入されました。td-agentがインストールされた後、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["/Library/LaunchDaemons/td-agent.plist"]},"ファイルを編集して、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["/usr/sbin/td-agent"]},"を**/opt/td-agent/usr/sbin/td-agent**に変更してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"windows-server-2012","__idx":10},"children":["Windows Server 2012+"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Windowsのインストールには、以下の詳細な手順が必要です:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.fluentd.org/installation/install-by-msi"},"children":["Installing Treasure Agent using .msi Installer (Windows)"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"opscode-chef-repository","__idx":11},"children":["Opscode Chef Repository"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/chef-td-agent?tab=readme-ov-file#description"},"children":["リポジトリの詳細を読む"]},"ことができます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ echo 'cookbook \"td-agent\"' >> Berksfile\n$ berks install\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/elastic-beanstalk-td-agent"},"children":["AWS Elastic Beanstalk"]},"もサポートされています。Windowsはサポートされていません。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"etctd-agenttd-agentconfの変更","__idx":12},"children":["/etc/td-agent/td-agent.confの変更"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/etc/td-agent/td-agent.conf"]},"ファイルで",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apikey"]},"オプションを設定して、APIキーを指定します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"# Input from HTTP\nsource\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 YOUR_API_KEY\n  auto_create_table\n  buffer_type file\n  buffer_path /var/log/td-agent/buffer/td\n  use_ssl true\n</match>\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["YOUR_API_KEY"]},"は、実際のAPIキー文字列に置き換えてください。APIキーは、Treasure コンソールのプロファイルから取得できます。",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/getting-your-api-keys"},"children":["書き込み専用APIキー"]},"の使用を推奨します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下の行を追加した後、エージェントを再起動してください:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"# Linux\n$ sudo /etc/init.d/td-agent restart\n\n# MacOS X\n$ sudo launchctl unload /Library/LaunchDaemons/td-agent.plist\n$ sudo launchctl load /Library/LaunchDaemons/td-agent.plist\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td-agentは、ポート24224経由でデータを受け入れ、データをバッファリング（",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["var/log/td-agent/buffer/td"]},"）し、自動的にクラウドにデータをアップロードします。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"http経由でレコードを送信","__idx":13},"children":["HTTP経由でレコードを送信"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下のコードスニペットを使用して、HTTP経由でローカルのTreasure Agentにレコードを送信します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"using System;\nusing System.Net;\nusing System.IO;\nusing System.Text;\nusing System.Web;\n\nnamespace CSharpTreasureAgentExample\n{\n  class MainClass\n  {\n    public static void Main (string[] args)\n    {\n      string json_body = \"{\\\"action\\\":\\\"login\\\",\\\"user\\\":2}\";\n      string tag = \"td.production.login\";\n\n      // Prepare HTTP Request Object\n      HttpWebRequest request = (HttpWebRequest)WebRequest.Create(\"http://localhost:8888/\" + tag);\n      request.Method = \"POST\";\n      request.ContentType = \"application/x-www-form-urlencoded\";\n      json_body = \"json=\" +  System.Web.HttpUtility.UrlEncode(json_body);\n      byte[] bytes = Encoding.ASCII.GetBytes(json_body);\n      request.ContentLength = bytes.Length;\n\n      // Write the Request\n      Stream stream = request.GetRequestStream();\n      stream.Write(bytes, 0, bytes.Length);\n      stream.Flush();\n      stream.Close();\n\n      // Receive the Response\n      HttpWebResponse response = (HttpWebResponse)request.GetResponse();\n      if (response.StatusCode == HttpStatusCode.OK) {\n        using (StreamReader reader = new StreamReader (response.GetResponseStream ())) {\n          Console.WriteLine (reader.ReadToEnd ());\n        }\n      }\n      response.Close();\n    }\n  }\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"データインポートの確認","__idx":14},"children":["データインポートの確認"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["プログラムを実行します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["SIGUSR1シグナルを送信すると、td-agentのバッファがフラッシュされます。アップロードは即座に開始されます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"# Linux\n$ kill -USR1 `cat /var/run/td-agent/td-agent.pid`\n\n# MacOS X\n$ sudo kill -USR1 `sudo launchctl list | grep td-agent | cut -f 1`\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"treasure-コンソールから","__idx":15},"children":["Treasure コンソールから"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データが正常にアップロードされたことを確認するには、Treasure コンソールのDatabasesビューでデータセットを確認してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"cliから","__idx":16},"children":["CLIから"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["または、CLIクライアントがある場合は、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["td tables"]},"コマンドを発行します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td tables\n+------------+------------+------+-----------+\n| Database   | Table      | Type | Count     |\n+------------+------------+------+-----------+\n| production | login      | log  | 1         |\n+------------+------------+------+-----------+\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"本番デプロイ","__idx":17},"children":["本番デプロイ"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"td-agentの高可用性構成","__idx":18},"children":["td-agentの高可用性構成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["高トラフィックのウェブサイト（5つ以上のアプリケーションノード）の場合、td-agentの高可用性構成を使用して、データ転送の信頼性とクエリパフォーマンスを向上させます。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/configuring-td-agent-for-high-availability"},"children":["High-Availability Configurations of td-agent"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"td-agentの監視","__idx":19},"children":["td-agentの監視"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td-agent自体の監視も重要です。td-agentの一般的な監視方法については、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/monitoring-td-agent"},"children":["Monitoring td-agent"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td-agentは、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"http://fluentd.org/"},"children":["Fluentdプロジェクト"]},"の下で完全にオープンソース化されています。"]}]},"headings":[{"value":".NET Apps Import Integration","id":"net-apps-import-integration","depth":1},{"value":"前提条件","id":"前提条件","depth":2},{"value":"Treasure Data IntegrationのIPホワイトリスト","id":"treasure-data-integrationのipホワイトリスト","depth":3},{"value":"td-agentのインストール","id":"td-agentのインストール","depth":2},{"value":"td-agentのインストールオプション","id":"td-agentのインストールオプション","depth":2},{"value":"RHEL/CentOS 5,6,7","id":"rhelcentos-567","depth":3},{"value":"Ubuntu and Debian","id":"ubuntu-and-debian","depth":3},{"value":"EOLバージョンのレガシーサポートはまだ利用可能です","id":"eolバージョンのレガシーサポートはまだ利用可能です","depth":3},{"value":"Amazon Linux","id":"amazon-linux","depth":3},{"value":"MacOS X 10.11+","id":"macos-x-1011","depth":3},{"value":"Windows Server 2012+","id":"windows-server-2012","depth":3},{"value":"Opscode Chef Repository","id":"opscode-chef-repository","depth":4},{"value":"/etc/td-agent/td-agent.confの変更","id":"etctd-agenttd-agentconfの変更","depth":2},{"value":"HTTP経由でレコードを送信","id":"http経由でレコードを送信","depth":2},{"value":"データインポートの確認","id":"データインポートの確認","depth":2},{"value":"Treasure コンソールから","id":"treasure-コンソールから","depth":4},{"value":"CLIから","id":"cliから","depth":4},{"value":"本番デプロイ","id":"本番デプロイ","depth":1},{"value":"td-agentの高可用性構成","id":"td-agentの高可用性構成","depth":2},{"value":"td-agentの監視","id":"td-agentの監視","depth":2}],"frontmatter":{"seo":{"title":".NET Apps Import Integration","description":".NET アプリケーションからTreasure AIへのデータインポート方法を解説。td-agentのインストール手順と設定方法を詳しく説明します。"}},"lastModified":"2026-06-17T07:22:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/int/net-apps-import-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}