Logo
Akamai APIs API Documentation

Create a stream

POST https://{{host}}/datastream-config-api/v2/log/streams

Creates a stream configuration. Within a stream configuration, you can select properties to monitor in the stream, data set fields to collect in logs, and a destination to send these log files to. Get the streamId value from the response to use in the https://{hostname}/datastream-config-api/v2/log/streams/{streamId} endpoint URL. Apart from the log and delivery frequency configurations, you can decide whether to activate the stream on making the request or later using the activate parameter. Note that only active streams collect and send logs to their destinations. See Activate a stream.

 

Body PARAM

Key Datatype Required Description 
activate
string (Optional) Activates the stream at the time of the request, `false` by default. When you [Edit a stream](https://techdocs.akamai.com/datastream2/reference/put-stream) or [Patch a stream](https://techdocs.akamai.com/datastream2/reference/patch-stream) that is active, you need to set this member to `true`.



HEADERS

Key Datatype Required Description 
Content-Type
string
Accept
string




RESPONSES

status Created

{ "collectMidgress": true, "contractId": "C-0N7RAC7", "createdBy": "alfulani", "createdDate": "2022-02-05T13:31:30Z", "datasetFields": [ { "datasetFieldId": 1000, "datasetFieldJsonKey": "cp", "datasetFieldName": "CP code" }, { "datasetFieldId": 1002, "datasetFieldJsonKey": "reqId", "datasetFieldName": "Request ID" }, { "datasetFieldId": 1023, "datasetFieldJsonKey": "cookie", "datasetFieldName": "Cookie" } ], "deliveryConfiguration": { "fieldDelimiter": "SPACE", "format": "STRUCTURED", "frequency": { "intervalInSeconds": 30 }, "uploadFilePrefix": "logs", "uploadFileSuffix": "ds" }, "destination": { "bucket": "datastream.akamai.com", "compressLogs": true, "destinationType": "S3", "displayName": "S3Destination", "path": "ds2-logs", "region": "ap-south-1" }, "groupId": 32145, "latestVersion": 1, "modifiedBy": "alfulani", "modifiedDate": "2022-02-05T13:31:30Z", "notificationEmails": [ "useremail1@domain.com", "useremail2@domain.com" ], "productId": "Dynamic_Site_Accelerator", "properties": [ { "propertyId": 349772, "propertyName": "example.com" }, { "propertyId": 349770, "propertyName": "example.akamai.com" } ], "streamId": 7050, "streamName": "diagnostics-log-stream", "streamStatus": "ACTIVATING", "streamVersion": 1 }



Curl
curl -X POST 'https://undefined/datastream-config-api/v2/log/streams?activate=' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"collectMidgress":false,"contractId":"K-0N7RAK7","datasetFields":[{"datasetFieldId":1000},{"datasetFieldId":1002},{"datasetFieldId":1023}],"deliveryConfiguration":{"format":"JSON","frequency":{"intervalInSeconds":30},"uploadFilePrefix":"logs_{%M}_{%Y}","uploadFileSuffix":"ds"},"destination":{"accessKey":"X17x2f2+2MxT1Eh/KaBApKrAEUnetiD0LBbQybczlOwpJVJHPYlDwV99nFSvhDd6z0YTdhDUmy6inRHjQPLlsA==","accountName":"Internet Company","containerName":"rawslogscontainer","destinationType":"AZURE","displayName":"azure_destination","path":"logs/edgelogs/{%Y/%m/%d/%H/%M/%S}"},"groupId":12345,"notificationEmails":["useremail1@domain.com","useremail2@domain.com"],"properties":[{"propertyId":349772},{"propertyId":349770}],"streamName":"diagnostics-log-stream"}'

ENDPOINTS