Help Center/ Log Tank Service/ API Reference/ Examples/ Example 5: Transferring Logs to OBS
Updated on 2024-10-28 GMT+08:00

Example 5: Transferring Logs to OBS

Scenario

This section describes how to transfer logs of one or more log streams to OBS.

Other Involved APIs

Call the following API to obtain the name of the OBS bucket to which logs will be transferred:

Listing Buckets

Transferring Logs to OBS

  • URI format

POST /v2/{project_id}/log-dump/obs

  • Example Request

POST https://{endpoint}/v2/{project_id}/log-dump/obs

Obtain the value of {endpoint} from Endpoints.

Body:

{ 
  "log_group_id": "d9dba9f3-xxxx-48bd-xxxx-xxxxa24a8053", 
  "log_stream_ids": ["45e7f609-xxxx-4cd3-835b-xxxx4a124718"], 
  "obs_bucket_name": "lts-test", 
  "type": "cycle", 
  "storage_format": "RAW", 
  "switch_on": "true", 
  "prefix_name": "fileprefixname", 
  "dir_prefix_name": "dirprefixname", 
  "period": 5, 
  "period_unit": "min" 
}
  • Example Response
{ 
  "log_dump_obs_id" : "45fdc36b-xxxx-4567-xxxx-559xxxxdf968" 
}