Create log sink | Integrations | Northflank API docs
v1
Double column
API
CLI
JS Client

Integrations /

Create log sink

Creates a new log sink.

Required permission

Account > Sinks > General > Create

Request body

  • {object}

    Create a log sink using Loki

    • name

      string required

      Name of the log sink.

    • description

      string

      Description of the log sink.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • restricted

      boolean

      If true, only logs from the projects in projects will be sent to the log sink.

    • projects

      [array]

      If restricted is true, only logs from these projects will be sent to the log sink.

      • string

        The ID of a project.

        pattern
        ^[A-Za-z0-9-]+$
    • sinkType

      string required

      The type of the log sink.

      one of
      loki
    • sinkData

      {object} required

      Details about the Loki log sink.

      • endpoint

        string required

        The endpoint of the Loki log sink.

      • encoding

        {object}

        Encoding options

        • codec

          string required

          Codec to encode logs in

          one of
          text, json
      • auth

        {object}

        Object containing authentication data for the log sink.

        • strategy

          string

          The authentication strategy.

          one of
          basic
        • user

          string

          The username for the log sink.

        • password

          string

          The password for the log sink.

OR
  • {object}

    Create a log sink using Datadog

    • name

      string required

      Name of the log sink.

    • description

      string

      Description of the log sink.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • restricted

      boolean

      If true, only logs from the projects in projects will be sent to the log sink.

    • projects

      [array]

      If restricted is true, only logs from these projects will be sent to the log sink.

      • string

        The ID of a project.

        pattern
        ^[A-Za-z0-9-]+$
    • sinkType

      string required

      The type of the log sink.

      one of
      datadog_logs
    • sinkData

      {object} required

      Details about the Datadog log sink.

      • default_api_key

        string required

        The Datadog API key.

      • region

        string required

        The Datadog region.

        one of
        eu, us, us3, us5
OR
  • {object}

    Create a log sink using Papertrail

    • name

      string required

      Name of the log sink.

    • description

      string

      Description of the log sink.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • restricted

      boolean

      If true, only logs from the projects in projects will be sent to the log sink.

    • projects

      [array]

      If restricted is true, only logs from these projects will be sent to the log sink.

      • string

        The ID of a project.

        pattern
        ^[A-Za-z0-9-]+$
    • sinkType

      string required

      The type of the log sink.

      one of
      papertrail
    • sinkData

      (multiple options: oneOf) required

      Papertrail Sink Schema.

      • {object}

        Authenticate with a host/port

        • authenticationStrategy

          string required

          The authentication strategy.

          one of
          port
        • host

          string required

          The host for the Papertrail log destination.

        • port

          number required

          The port for the Papertrail log destination.

        OR

      • {object}

        Authenticate with a token.

        • authenticationStrategy

          string required

          The authentication strategy.

          one of
          token
        • uri

          string required

          The uri for the Papertrail log destination.

        • token

          string required

          The HTTP Token for the Papertrail log destination.

OR
  • {object}

    Create a log sink using AWS S3

    • name

      string required

      Name of the log sink.

    • description

      string

      Description of the log sink.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • restricted

      boolean

      If true, only logs from the projects in projects will be sent to the log sink.

    • projects

      [array]

      If restricted is true, only logs from these projects will be sent to the log sink.

      • string

        The ID of a project.

        pattern
        ^[A-Za-z0-9-]+$
    • sinkType

      string required

      The type of the log sink.

      one of
      aws_s3
    • sinkData

      {object} required

      Details about the AWS S3 log sink.

      • endpoint

        string required

        Endpoint for the AWS S3 or compatible API bucket.

      • region

        string required

        Region of the S3 bucket.

        one of
        eu-west-1, eu-west-2, eu-west-3, eu-central-1, eu-south-1, eu-north-1, us-west-1, us-west-2, us-east-1, us-east2
      • auth

        {object}

        Authentication object.

        • accessKeyId

          string required

          Access key id for the bucket.

        • secretAccessKey

          string required

          Secret access key for the bucket.

      • bucket

        string required

        Name of the S3 Bucket.

      • compression

        string required

        Log file compression method.

        one of
        gzip, none
OR
  • {object}

    Create a log sink using HTTP

    • name

      string required

      Name of the log sink.

    • description

      string

      Description of the log sink.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • restricted

      boolean

      If true, only logs from the projects in projects will be sent to the log sink.

    • projects

      [array]

      If restricted is true, only logs from these projects will be sent to the log sink.

      • string

        The ID of a project.

        pattern
        ^[A-Za-z0-9-]+$
    • sinkType

      string required

      The type of the log sink.

      one of
      http
    • sinkData

      {object} required

      Details about the HTTP log sink.

      • uri

        string required

        Uri to send logs to.

      • encoding

        {object}

        Encoding options

        • codec

          string required

          Codec to encode logs in

          one of
          text, json
      • auth

        (multiple options: oneOf) required
        • (multiple options: oneOf)
          • {object}

            No authentication strategy

            • strategy

              string required

              No authentication strategy

              one of
              none

            OR

          • {object}

            Authenticate with a basic http strategy.

            • strategy

              string required

              Basic HTTP authentication strategy.

              one of
              basic
            • user

              string

              Username for basic http authentication.

            • password

              string required

              Password for basic http authentication.

            OR

          • {object}

            Authenticate with a bearer token strategy.

            • strategy

              string required

              Bearer token authentication strategy.

              one of
              bearer
            • token

              string

              Token for bearer token authentication.

OR
  • {object}

    Create a log sink using LogDNA

    • name

      string required

      Name of the log sink.

    • description

      string

      Description of the log sink.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • restricted

      boolean

      If true, only logs from the projects in projects will be sent to the log sink.

    • projects

      [array]

      If restricted is true, only logs from these projects will be sent to the log sink.

      • string

        The ID of a project.

        pattern
        ^[A-Za-z0-9-]+$
    • sinkType

      string required

      The type of the log sink.

      one of
      logdna
    • sinkData

      {object} required

      Details about the LogDNA log sink.

      • api_key

        string required

        Ingestion Key

OR
  • {object}

    Create a log sink using Better Stack

    • name

      string required

      Name of the log sink.

    • description

      string

      Description of the log sink.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • restricted

      boolean

      If true, only logs from the projects in projects will be sent to the log sink.

    • projects

      [array]

      If restricted is true, only logs from these projects will be sent to the log sink.

      • string

        The ID of a project.

        pattern
        ^[A-Za-z0-9-]+$
    • sinkType

      string required

      The type of the log sink.

      one of
      betterStack
    • sinkData

      {object} required

      Details about the Better Stack log sink.

      • token

        string required

        Better Stack Source Token

OR
  • {object}

    Create a log sink using Honeycomb

    • name

      string required

      Name of the log sink.

    • description

      string

      Description of the log sink.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • restricted

      boolean

      If true, only logs from the projects in projects will be sent to the log sink.

    • projects

      [array]

      If restricted is true, only logs from these projects will be sent to the log sink.

      • string

        The ID of a project.

        pattern
        ^[A-Za-z0-9-]+$
    • sinkType

      string required

      The type of the log sink.

      one of
      honeycomb
    • sinkData

      {object} required

      Details about the Honeycomb log sink.

      • api_key

        string required

        Honeycomb API Key

      • dataset

        string required

        Name of the dataset

OR
  • {object}

    Create a log sink using Logz.io

    • name

      string required

      Name of the log sink.

    • description

      string

      Description of the log sink.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • restricted

      boolean

      If true, only logs from the projects in projects will be sent to the log sink.

    • projects

      [array]

      If restricted is true, only logs from these projects will be sent to the log sink.

      • string

        The ID of a project.

        pattern
        ^[A-Za-z0-9-]+$
    • sinkType

      string required

      The type of the log sink.

      one of
      logzio
    • sinkData

      {object} required

      Details about the Logz.io log sink.

      • region

        string required

        Your Logzio region code

        one of
        eu, uk, us, ca, au, nl, wa
      • token

        string required

        The Log Shipping Token of the account you want to ship to

OR
  • {object}

    Create a log sink using Axiom

    • name

      string required

      Name of the log sink.

    • description

      string

      Description of the log sink.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • restricted

      boolean

      If true, only logs from the projects in projects will be sent to the log sink.

    • projects

      [array]

      If restricted is true, only logs from these projects will be sent to the log sink.

      • string

        The ID of a project.

        pattern
        ^[A-Za-z0-9-]+$
    • sinkType

      string required

      The type of the log sink.

      one of
      axiom
    • sinkData

      {object} required

      Details about the Axiom log sink.

      • dataset

        string required

        Name of the data

      • token

        string required

        Axiom API/Personal token

      • tokenType

        string required

        Using a personal token

        one of
        personal, api
      • orgId

        string

        The ID of the organisation, required if using a personal token

      • url

        string required

        The Axiom url to use. Only change if self hosting axiom.

OR
  • {object}

    Create a log sink using New Relic

    • name

      string required

      Name of the log sink.

    • description

      string

      Description of the log sink.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • restricted

      boolean

      If true, only logs from the projects in projects will be sent to the log sink.

    • projects

      [array]

      If restricted is true, only logs from these projects will be sent to the log sink.

      • string

        The ID of a project.

        pattern
        ^[A-Za-z0-9-]+$
    • sinkType

      string required

      The type of the log sink.

      one of
      newRelic
    • sinkData

      {object} required

      Details about the New Relic log sink.

      • accountId

        string required

        New Relic Account ID

      • licenseKey

        string required

        New Relic License Key

Response body

  • {object}

    Response object.

    • data

      {object} required

      Result data.

      • id

        string required

        The ID of the new log sink.

API
CLI
JS Client

POST /v1/integrations/log-sinks

Example request

Request body
Create a log sink using Loki
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"example-log-sink","description":"This is an example log sink.","restricted":true,"projects":["default-project"],"sinkType":"loki","sinkData":{"endpoint":"https://logs.example.com","encoding":{"codec":"json"},"auth":{"strategy":"basic","user":"admin","password":"password1234"}}}' \
  https://api.northflank.com/v1/integrations/log-sinks
OR
Create a log sink using Datadog
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"example-log-sink","description":"This is an example log sink.","restricted":true,"projects":["default-project"],"sinkType":"datadog_logs","sinkData":{"default_api_key":"abcdef12345678900000000000000000","region":"eu"}}' \
  https://api.northflank.com/v1/integrations/log-sinks
OR
Create a log sink using Papertrail
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"example-log-sink","description":"This is an example log sink.","restricted":true,"projects":["default-project"],"sinkType":"papertrail","sinkData":{"authenticationStrategy":"port","host":"logs1.papertrailapp.com:","port":8000}}' \
  https://api.northflank.com/v1/integrations/log-sinks
OR
Create a log sink using AWS S3
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"example-log-sink","description":"This is an example log sink.","restricted":true,"projects":["default-project"],"sinkType":"aws_s3","sinkData":{"endpoint":"my.bucket.com","region":"eu-west-2","auth":{"accessKeyId":"PMSACIHNUIASDBWQDS","secretAccessKey":"HA1PLMNOEAEYUHAJQMSDUJQS"},"bucket":"northflank-logs","compression":"gzip"}}' \
  https://api.northflank.com/v1/integrations/log-sinks
OR
Create a log sink using HTTP
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"example-log-sink","description":"This is an example log sink.","restricted":true,"projects":["default-project"],"sinkType":"http","sinkData":{"uri":"my.log-collector.com","encoding":{"codec":"json"},"auth":{"strategy":"none"}}}' \
  https://api.northflank.com/v1/integrations/log-sinks
OR
Create a log sink using LogDNA
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"example-log-sink","description":"This is an example log sink.","restricted":true,"projects":["default-project"],"sinkType":"logdna","sinkData":{"api_key":"b1dd3feb585asd1a3e9edpo9kmn5e590hg9"}}' \
  https://api.northflank.com/v1/integrations/log-sinks
OR
Create a log sink using Better Stack
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"example-log-sink","description":"This is an example log sink.","restricted":true,"projects":["default-project"],"sinkType":"betterStack","sinkData":{"token":"vhnqrLygVQ5GnSQUTZamKvAq"}}' \
  https://api.northflank.com/v1/integrations/log-sinks
OR
Create a log sink using Honeycomb
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"example-log-sink","description":"This is an example log sink.","restricted":true,"projects":["default-project"],"sinkType":"honeycomb","sinkData":{"api_key":"b1dd3feb585asd1a3e9","dataset":"staging-logs"}}' \
  https://api.northflank.com/v1/integrations/log-sinks
OR
Create a log sink using Logz.io
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"example-log-sink","description":"This is an example log sink.","restricted":true,"projects":["default-project"],"sinkType":"logzio","sinkData":{"region":"eu","token":"sNFijNFgNFoNFrMsNFbNFObNFcgNFqoa"}}' \
  https://api.northflank.com/v1/integrations/log-sinks
OR
Create a log sink using Axiom
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"example-log-sink","description":"This is an example log sink.","restricted":true,"projects":["default-project"],"sinkType":"axiom","sinkData":{"dataset":"staging","token":"b1dd3feb585asd1a3e9edpo9kmn5e590hg9"}}' \
  https://api.northflank.com/v1/integrations/log-sinks
OR
Create a log sink using New Relic
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"example-log-sink","description":"This is an example log sink.","restricted":true,"projects":["default-project"],"sinkType":"newRelic","sinkData":{"accountId":"b1dd3feb585asd1a3e9","licenseKey":"b1dd3feb585asd1a3e9"}}' \
  https://api.northflank.com/v1/integrations/log-sinks

Example response

200 OK

Details about a log sink.

JSON

{
  "data": {
    "id": "example-log-sink"
  }
}

© 2024 Northflank Ltd. All rights reserved.