We're launching a new cybersecurity venture! Learn more about Snowbit >

FluentD FluentD

Last Updated: Apr. 14, 2022

Coralogix provides seamless integration with FluentD so you can send your logs from anywhere and parse them according to your needs.

Prerequisites

  • FluentD Installed (Official documentation Here)
  • Active Coralogix account

Configuration

We recommend using the generic HTTP output plugin, as it has plenty of adjustability and exposed metrics.
To start sending logs to Coralogix, you will need to add us as an output on your configuration.
This is a generic example where all you need to supply is your cluster URL (please see table below) and account private key (Please note that the key should be inserted without quotation marks or apostrophes).

<label @CORALOGIX>
  <filter **>
    @type record_transformer
    @log_level warn
    enable_ruby true
    auto_typecast true
    renew_record true
    <record>
      # In this example we are using record.dig to dynamically set values.
      # Values can also be static or simple variables
      applicationName ${record.dig("kubernetes", "namespace_name")}
      subsystemName ${record.dig("kubernetes", "container_name")}
      computerName ${record.dig("kubernetes", "host")}
      timestamp ${time.strftime('%s%L')} # Optional
      text ${record.to_json}
    </record>
  </filter>
  <match **>
    @type http
    @id coralogix
    endpoint "<your cluster singles url>"
    headers {"private_key":<your cluster's private key>}
    retryable_response_codes 503
    error_response_as_unrecoverable false
    <buffer>
      @type memory
      chunk_limit_size 5MB
      compress gzip
      flush_interval 1s
      overflow_action block
      retry_max_times 5
      retry_type periodic
      retry_wait 2
    </buffer>
    <secondary>
      #If any messages fail to send they will be send to STDOUT for debug.
      @type stdout
    </secondary>
  </match>
</label>

Parameters and descriptions

Depending on your account’s geolocation you will need to provide the relevant URL to the configuration above:

Cluster NameURL
EUhttps://api.coralogix.com/logs/rest/singles
UShttps://api.coralogix.us/logs/rest/singles
SGhttps://api.coralogixsg.com/logs/rest/singles
INhttps://api.app.coralogix.in/logs/rest/singles
Private linkhttps://private-link-api.coralogix.us/logs/rest/singles

If you have any questions or need additional guidance, our support team is available 24/7 via our in-app chat!

On this page