{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Products","product_name":"Integration Hub","type":"markdown"},"seo":{"title":"Fluentd Collecting Logs Through an HTTP Protocol","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":"fluentd-collecting-logs-through-an-http-protocol","__idx":0},"children":["Fluentd Collecting Logs Through an HTTP Protocol"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td-agent was discontinued in December 2023 and has been replaced by ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["fluent-package"]},". The fluent-package is the official successor maintained by the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.cncf.io/projects/"},"children":["Cloud Native Computing Foundation"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use HTTP to add logs from many places to Fluentd."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#prerequisites"},"children":["Prerequisites"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#configuration"},"children":["Configuration"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#uploading-data-via-http"},"children":["Uploading Data via HTTP"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Basic knowledge of Treasure Data, including the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/tools/cli-and-sdks/quickstart"},"children":["TD Toolbelt"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configuration","__idx":2},"children":["Configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add the following lines to your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/etc/fluent/fluentd.conf"]}," file."]},{"$$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 YOUR_API_KEY\n  auto_create_table\n  use_ssl true\n  <buffer>\n    @type file\n    path /var/log/fluent/buffer/td\n  </buffer>\n</match>\n","lang":"conf"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"uploading-data-via-http","__idx":3},"children":["Uploading Data via HTTP"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can add logs via HTTP by sending JSON data. Use the POST method and specify the database and table name by URL."]},{"$$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":["Fluentd continuously uploads logs every minute. Sending a SIGUSR1 signal flushes the buffer. Uploads start immediately."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"kill -USR1 $(cat /var/run/fluent/fluentd.pid)\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To confirm that your data has been uploaded successfully, issue the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td tables"]}," command as shown below."]},{"$$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":["If you run into an issue, your log (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/var/log/fluent/fluentd.log"]},") is a good place to start troubleshooting."]}]},"headings":[{"value":"Fluentd Collecting Logs Through an HTTP Protocol","id":"fluentd-collecting-logs-through-an-http-protocol","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Configuration","id":"configuration","depth":2},{"value":"Uploading Data via HTTP","id":"uploading-data-via-http","depth":2}],"frontmatter":{"seo":{"title":"Fluentd Collecting Logs Through an HTTP Protocol"}},"lastModified":"2026-02-17T05:21:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/integration-hub/streaming/td-agent/td-agent-collecting-logs-through-an-http-protocol","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}