Add fleet configuration files

Add fleet configuration files

Many types of files can be added to fleet configurations, including:

  • Parsers
  • Includes
  • Lua scripts
  • Authentication tokens

Files of a reasonable size and with a name consisting of alphanumeric characters and dots can be added as fleet files. There is no restriction in place based on content.

To add files to a fleet, use the create fleet_file command:

calyptia create fleet_file --fleet {FLEET_NAME} --file {FILENAME}

Adding a file to a fleet causes a new version of the configuration to download on each Calyptia Core Agent using the previous file, in a way that is directly accessible to the Calyptia Core Agent as if it were in the same directory.

For example, to add a parser file to a fleet configuration:

$ cat << EOF > fluent-bit.conf
    # The file parsers.conf will be accessible as if it were in the
    # current directory of fluent-bit. These files can be referenced
    # from any place in the configuration.
    Parsers_File parsers.conf
    Name   syslog
    Parser syslog-rfc3164-local
    Name  stdout
    Match *
$ cat << EOF > parsers.conf
    Name        syslog-rfc3164-local
    Format      regex
    Regex       ^\<(?<pri>[0-9]+)\>(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$
    Time_Key    time
    Time_Format %b %d %H:%M:%S
    Time_Keep   On
$ calyptia create fleet --name fleet-parsers --config-file fluent-bit.conf
$ calyptia create fleet_file --fleet fleet-parsers --file parsers.conf