# TD Agent Collecting Logs Through an Http Protocol You can use HTTP to add logs from many places to Treasure Agent (td-agent). * [Prerequisites](/products/customer-data-platform/integration-hub/streaming/td-agent/td-agent-collecting-logs-through-an-http-protocol#prerequisites) * [Configuration](/products/customer-data-platform/integration-hub/streaming/td-agent/td-agent-collecting-logs-through-an-http-protocol#configuration) * [Uploading Data via HTTP](/products/customer-data-platform/integration-hub/streaming/td-agent/td-agent-collecting-logs-through-an-http-protocol#uploading-data-via-http) # Prerequisites * Basic knowledge of Treasure Data, including the [TD Toolbelt](/tools/cli-and-sdks/td-toolbelt). # Configuration Add the following lines to your */etc/td-agent/td-agent.conf* file. ```conf # HTTP input type http port 8888 # Treasure Data output type tdlog endpoint api.treasuredata.com apikey ... auto_create_table buffer_type file buffer_path /var/log/td-agent/buffer/td use_ssl true ``` # Uploading Data via HTTP You can add logs via HTTP by sending JSON data. Use the POST method and specify the database and table name by URL. ```bash $ curl -X POST -d 'json={"action":"login","user":2}' \ http://localhost:8888/td.testdb.www_access ``` td-agent continuously uploads logs every minute. Sending a SIGUSR1 signal flushes the buffer. Uploads start immediately. ```bash kill -USR1 `cat /var/run/td-agent/td-agent.pid` ``` To confirm that your data has been uploaded successfully, issue the *td tables* command as shown below. ```bash $ td tables +------------+------------+------+-----------+ | Database | Table | Type | Count | +------------+------------+------+-----------+ | testdb | www_access | log | 1 | +------------+------------+------+-----------+ ``` If you run into an issue, your log (/var/log/td-agent.log) is a good place to start troubleshooting.