Using Fluentd

Fluentd (or td-agent) has many features and can collect and route different types of logs to different destinations. Filtering audit logs, user-trail, reporting records, different log levels, etc. is possible, for example. Airlock IAM can be integrated with Fluentd in both Container and traditional environments.

Installing Fluentd

See the official Fluentd documentation for more details:

Below is an example installation on CentOS:

curl -L | sh # You may also download this first and check it
systemd enable --now td-agent

It's possible and recommended to use a single instance of Fluentd for multiple instances/installations of Airlock IAM to simplify management.

Fluentd and Elasticsearch

When using the default Elasticsearch templates from Airlock, log messages are split into separate indexes automatically. This allows separate lifecycles to be implemented efficiently. Using Fluend it is possible to perform additional processing and routing upfront. Examples include routing audit logs to a different location for safer long-term storage.

Example splitting log records by "type":


# Extract "type" from log record and use it as fluend tag
<match airlock-iam.**>
  @type rewrite_tag_filter
    key type
    pattern /(.*)/
    tag airlock-iam.$1

In td-agent.conf, you may include this file, and use match expressions, to refer to the tagged logs separately:


@include /etc/td-agent/td-agent.conf.d/*

<match airlock-iam.**>
   type copy
      @type elasticsearch
      port 9200
      logstash_format true
      logstash_prefix airlock-iam-${tag_parts[1]}
      flush_interval 15