> ## Documentation Index
> Fetch the complete documentation index at: https://www.ravion.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream CloudWatch logs (SSE)

> Stream CloudWatch logs via SSE. Fetches historical logs first, then optionally tails for new logs.



## OpenAPI

````yaml https://api.ravion.com/openapi.yaml get /aws/cloudwatch/stream
openapi: 3.0.0
info:
  title: Ravion
  version: 0.0.0
servers:
  - url: https://api.ravion.com
security:
  - BearerAuth: []
tags:
  - name: Projects
  - name: Environments
  - name: Pipelines
  - name: PipelineRuns
  - name: TerraformResources
  - name: TerraformExecutionSummaries
  - name: PipelineStepExecutions
  - name: AwsCloudWatch
  - name: PipelineVersions
  - name: Organizations
  - name: Stacks
  - name: StackWorkspaces
  - name: Auth
  - name: OAuth
  - name: User
  - name: Health
  - name: Memberships
  - name: ServiceAccounts
  - name: AwsDefaultNetworks
  - name: AwsAccounts
  - name: ApiKeys
  - name: ExecutionEnvironments
  - name: ModuleDefinitions
  - name: ModuleVersions
  - name: ModuleInstances
  - name: DefaultValueDefinitions
  - name: DefaultValues
  - name: CodeSources
  - name: Github
  - name: Gitlab
  - name: Git
  - name: Values
  - name: Deployments
  - name: DeploymentResources
  - name: InfrastructureEvents
  - name: WebSocket
  - name: Describe
paths:
  /aws/cloudwatch/stream:
    get:
      tags:
        - AwsCloudWatch
      summary: Stream CloudWatch logs (SSE)
      description: >-
        Stream CloudWatch logs via SSE. Fetches historical logs first, then
        optionally tails for new logs.
      operationId: StreamCloudWatchLogs
      parameters:
        - description: Database ID of the AwsAccount to use for credentials
          in: query
          name: awsAccountId
          required: true
          schema:
            nullable: true
            type: string
        - description: >-
            CloudWatch log group names to stream from (e.g.,
            /flightcontrol/runner). Usually a single group; the ECS task-detail
            drawer passes several because a single task's containers can log to
            different groups (a FireLens-routed app plus awslogs sidecars). Each
            group is queried with the same stream filter and the results are
            merged and deduped. At least one group is required.
          in: query
          name: logGroupNames
          required: true
          schema:
            items:
              type: string
            type: array
        - description: >-
            Log stream prefix to filter by (e.g., {commandId}/{instanceId}).
            Mutually exclusive with logStreamNames — pass exactly one.
          in: query
          name: logStreamPrefix
          schema:
            nullable: true
            type: string
        - description: >-
            Explicit list of log stream names to filter by. When set, the
            handler uses FilterLogEvents with logStreamNames instead of
            logStreamNamePrefix, which lets the task-detail drawer scope its
            feed to the exact CloudWatch streams (<prefix>/<container>/<taskId>)
            owned by a single ECS task. Mutually exclusive with logStreamPrefix.
          in: query
          name: logStreamNames
          schema:
            items:
              type: string
            nullable: true
            type: array
        - description: AWS region where logs are stored
          in: query
          name: region
          required: true
          schema:
            nullable: true
            type: string
        - description: >-
            Start time for historical logs (ISO 8601). Defaults to beginning of
            log stream.
          in: query
          name: startTime
          schema:
            nullable: true
            type: string
        - description: >-
            End time for historical logs (ISO 8601). Defaults to now. Ignored if
            tail=true.
          in: query
          name: endTime
          schema:
            nullable: true
            type: string
        - description: >-
            If true, after fetching historical logs, switch to live tail mode
            for real-time streaming
          in: query
          name: tail
          schema:
            nullable: true
            type: boolean
        - description: >-
            Optional CloudWatch FilterPattern (e.g. "ERROR" or
            "\"deploy_id\":\"abc\"") applied to historical and live-tail events.
            Empty string disables filtering.
          in: query
          name: filterPattern
          schema:
            nullable: true
            type: string
      responses:
        '200':
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/CloudWatchLogBatchEvent'
          description: SSE stream of CloudWatch log events
components:
  schemas:
    CloudWatchLogBatchEvent:
      additionalProperties: false
      description: SSE event containing a batch of log events
      properties:
        events:
          description: Batch of log events
          items:
            $ref: '#/components/schemas/CloudWatchLogEvent'
          type: array
        isFinal:
          description: Whether this is the final batch of historical logs
          type: boolean
      required:
        - events
        - isFinal
      type: object
    CloudWatchLogEvent:
      additionalProperties: false
      description: A single CloudWatch log event
      properties:
        ingestionTime:
          description: Time when the event was ingested by CloudWatch (ISO 8601)
          type: string
        level:
          description: >-
            The log's severity level: one of `debug`, `info`, `warn`, or
            `error`.
          type: string
        logStreamName:
          description: Name of the log stream this event came from
          type: string
        message:
          description: The log message
          type: string
        timestamp:
          description: Log event timestamp in ISO 8601 format
          type: string
      required:
        - timestamp
        - message
        - logStreamName
      type: object
  securitySchemes:
    BearerAuth:
      scheme: Bearer
      type: http

````