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

# Create a new forward config to archive your logs in another system

> Create a forward config, to forward log events outside the Bronto system (e.g. archive logs in an S3 bucket)

This feature allows users to forward log events outside of Bronto. A common use case would be archiving your log data to an AWS S3 bucket.


## OpenAPI

````yaml post /forward-configs
openapi: 3.0.2
info:
  title: Bronto API
  license:
    name: Commercial
  version: 1.0.0
servers:
  - url: https://api.eu.bronto.io
  - url: https://api.us.bronto.io
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: api-keys
    description: >
      An Application Programming Interface (API) key is a unique identifier. 

      The API Key must be provided as X-BRONTO-API-KEY in headers for the
      request to be authenticated 

      and authorized by the API server according to the API Key's role. For
      further information about 

      roles visit [our API Key docs] 
      https://docs.bronto.io/manage/manage-api-keys
  - name: context
    description: >
      Context is a REST API resource that allows the retrieval of a specified
      number of log events (default of 100) around 

      a log event of interest, e.g. when a number of log events were returned by
      a previous query and you then decide you 

      want to see the 50 log events before one of those returned log events. Log
      events can be retrieved either before, 

      after, or both before and after the specified log event.
  - name: exports
    description: >
      The Bronto Export API allows you to efficiently download large volumes of
      log data for further analysis.

      The data to be exported can be filtered by entering the search parameters
      \"from\", \"where\" and \"time_range\" as

      per a normal query in the \"search_details\" object.


      To export data the following steps are required:

      1. Create an export using a POST request, which will return an
      \"export_id\", \"status\" and \"progress\".

      2. Use the export id to get the status of the export task by sending a GET
      request,

      which will return \"status\" and \"progress\" with a value of percentage
      completed. When the export is

      completed, the \"status\" will be \"COMPLETE\"

      3. Once the export task has completed you can download your data using
      curl (or similar)

      from the \"location\" URL returned in the GET response.
  - name: logs
    description: >
      Logs are a sequence of timestamped log events. Logs can be searched to
      view events matching a filter 

      or to perform statistical functions on matching events.
  - name: search
    description: >
      The REST API for searching data uses queries based on a subset of SQL,
      with

      the syntax as per
      https://docs.brontobytes.io/core-features/log-search/query-syntax/.
  - name: top-keys
    description: >
      Top-Keys is a REST API resource that allows you to easily retrieve the top
      keys for a specific log.
  - name: usage
    description: >
      Usage is a REST API resource that allows you to easily track your Bronto
      usage by retrieving usage data relating 

      to data ingestion and amount of data searched, and allowing you to drill
      down for a specific dataset over a defined timeframe.
  - name: users
    description: >
      Users are given specific roles, where each role determines the user's
      permissions within the application. Those roles are as follows:

      - "Admin" role has permission for all actions on all entities in the
      application.

      - "Standard" role allows Read/Write and Delete actions on entities in
      non-sensitive areas of the application.

      - "ReadOnly" role allows only read actions and only on entities in
      non-sensitive areas of the application.
paths:
  /forward-configs:
    post:
      tags:
        - forward
      summary: Create a new forward config to archive your logs in another system
      description: >-
        Create a forward config, to forward log events outside the Bronto system
        (e.g. archive logs in an S3 bucket)
      operationId: createForwardConfig
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForwardConfigRequest'
        required: true
      responses:
        '201':
          description: Forward config is created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForwardConfig'
        '400':
          description: Bad Request - The body in the request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Forbidden - The user does not have the privileges to create new
            forward config
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Request - Fair usage limits exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - An error occurred on the server side.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ForwardConfigRequest:
      required:
        - all_logs
        - compression
        - destination
        - name
      type: object
      properties:
        name:
          maxLength: 255
          minLength: 1
          type: string
          description: The name of the config
          example: Archive data to S3
        description:
          maxLength: 1000
          type: string
          description: Extra contextual information to add to the forward config.
          example: Sending data to S3 for long term store
        filter:
          maxLength: 2000
          type: string
          description: Optional filter, to forward only some events and discard others
          example: level='ERROR' or level='WARN'
        compression:
          type: string
          description: >-
            The compression algorithm to use, to reduce the payload size (ZSTD
            recommended)
          default: ZSTD
          enum:
            - ZSTD
            - GZIP
            - NONE
        all_logs:
          type: boolean
          description: >-
            True to forward all logs, logs created in future will be
            automatically forwarded
        log_ids:
          maxLength: 250
          type: array
          description: >-
            The list of log ids to forward. Required if all_logs is set to
            false, ignored if all_logs is set to true
          items:
            type: string
        max_payload_size_bytes:
          maximum: 1000000000
          minimum: 1000000
          type: number
          description: >-
            The max size of the payload in bytes, before compression. Payload of
            smaller size can be delivered by the system
          format: int32
          example: 10000000
          default: 10000000
        max_payload_size_events:
          maximum: 1000000000
          minimum: 1000
          type: number
          description: >-
            The max number of log events in a payload. Payloads with less events
            can be delivered by the system
          format: int32
          example: 1000
          default: 1000000
        max_buffer_time_ms:
          maximum: 86400000
          minimum: 60000
          type: number
          description: >-
            The maximum time waited by the system while buffering events to
            build a payload
          format: int32
          example: 300000
          default: 300000
        destination:
          $ref: '#/components/schemas/ForwardConfigDestination'
    ForwardConfig:
      required:
        - all_logs
        - compression
        - created_at
        - destination
        - id
        - name
      type: object
      properties:
        id:
          type: string
          description: unique identifier for the config
          format: uuid
        name:
          maxLength: 255
          minLength: 1
          type: string
          description: The name of the config
          example: Archive data to S3
        description:
          maxLength: 1000
          type: string
          description: Extra contextual information to add to the forward config.
          example: Sending data to S3 for long term store
        filter:
          maxLength: 2000
          type: string
          description: Optional filter to forward only some events and discard others
          example: level='ERROR' or level='WARN'
        compression:
          type: string
          description: The compression to use to reduce the payload size
          default: ZSTD
          enum:
            - ZSTD
            - GZIP
            - NONE
        all_logs:
          type: boolean
          description: >-
            True to forward all logs, logs created in future will be
            automatically forwarded
        log_ids:
          maxLength: 250
          type: array
          description: >-
            The list of log ids to forward. Required if all_logs is set to
            false, ignored if all_logs is set to true
          items:
            type: string
        max_payload_size_bytes:
          maximum: 1000000000
          minimum: 1000000
          type: number
          description: >-
            The max size of the payload in bytes, before compression. Payload of
            smaller size can be delivered by the system
          format: int32
          example: 10000000
          default: 10000000
        max_payload_size_events:
          maximum: 1000000000
          minimum: 1000
          type: number
          description: >-
            The max number of log events in a payload. Payloads with less events
            can be delivered by the system
          format: int32
          example: 1000
          default: 1000000
        max_buffer_time_ms:
          maximum: 86400000
          minimum: 60000
          type: number
          description: >-
            The maximum time waited by the system while buffering events to
            build a payload.
          format: int32
          example: 300000
          default: 300000
        destination:
          $ref: '#/components/schemas/ForwardConfigDestination'
        created_at:
          type: integer
          description: The timestamp when the config was created
          format: int64
          example: 1710948395538
    ErrorResponse:
      required:
        - code
        - correlation_id
        - message
      type: object
      properties:
        code:
          minimum: 200
          type: integer
          description: The http response code.
          format: int32
        correlation_id:
          type: string
          description: The unique identifier for the request.
        message:
          type: string
    ForwardConfigDestination:
      required:
        - bucket
        - destination_type
      type: object
      properties:
        destination_type:
          type: string
          description: The destination type. Only S3 currently supported
          example: S3
          enum:
            - S3
        bucket:
          maxLength: 255
          type: string
          description: The bucket name
          example: my-archive-bucket
        prefix:
          maxLength: 255
          type: string
          description: The key prefix for S3 objects
          example: bronto/archives/
        storage_class:
          type: string
          description: The S3 storage class to use for the objects
          example: STANDARD
          default: STANDARD
          enum:
            - STANDARD
            - STANDARD_IA
            - GLACIER_IR
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: X-BRONTO-API-KEY
      in: header
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````