fbpx
GEThttps://api.spotinst.io/aws/ec2/group/{GROUP_ID}/logs?fromDate={FROM_DATE}&toDate={TO_DATE}&severity={SEVERITY}&resourceId={RESOURCE_ID}&limit={LIMIT}&accountId={ACCOUNT_ID}

You can fetch a group’s elastilog via the Spotinst API, in order to be able to consume elastilog from various tools used for log storing and analyzing.

URL Parameters

Parameter Type Description
GROUP_ID * String

Group id from which to fetch elastilog

Example: sig-123456
FROM_DATE * String

Epoch number that represents the date from which to collect the log (millisecond format)

Example: 1540036800000
TO_DATE * String

Epoch number that represents the date until which log is collected (millisecond format)

Example: 1542715200000
ACCOUNT_ID * String

Your Spotinst accountId associated with your token

Example: act-123abc
SEVERITY String

Severity of log entries to extract.
Valid Values: ALL, INFO,DEBUG,WARN

Default: ALL
RESOURCE_ID String

Filter log extracted entires related to a specific resource id

Example: i-12345678
Default: Null
LIMIT String

Maximum number of lines to extract in a response. Max value allowed - 1000.

Default: 500
Request

Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer ${token}"
}
Response - 200

Headers
{
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "request": {
    "id": "3213f42e-455e-4801-a185-cd3eb65fac5f",
    "url": "/aws/ec2/group/sig-123456/logs?",
    "method": "GET",
    "time": "2018-11-19T13:49:11.911Z"
  },
  "response":{
   	"status":{
      "code":200,
      "message":"OK"
   },
   	"kind":"spotinst:aws:ec2:group:log",
   	"items":[
      {
         "message":"ECS Max Capacity: ECS Autoscaler - Cannot scale up since group has reached maximum capacity",
         "severity":"WARN",
         "createdAt":"2018-11-19T14:38:34.000Z"
      },
      {
         "message":"Group sig-e0a2bd7c successfully created.",
         "severity":"INFO",
         "createdAt":"2018-11-19T14:34:15.000Z"
      }
   	],
   	"count":2
	}
}