Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

fluent-bit-plugin-site24x7

Fluent Bit output plugin to forward logs to Site24x7 AppLogs. This is the Fluent Bit counterpart of fluent-plugin-site24x7 (Fluentd), built as a Go shared library using the fluent-bit-go interface.

How it works

The plugin parses records according to the Log Type configured in Site24x7 — JSON logs via its jsonPath mapping, plain-text logs via its line regex (no Fluent Bit parser configuration needed) — then resolves the log timestamp from the configured date field, applies the Log Profile's masking/hashing/derived-field/filter rules, batches up to 500 records / 5 MB per request, gzip-compresses the payload, and uploads it to your account's AppLogs endpoint with the required X-DeviceKey / X-LogType / Log-Size headers.

Requirements

  • Fluent Bit >= 1.9 (any build with Go plugin support; official packages and Docker images include it)
  • Go >= 1.21 (build only)
  • A Site24x7 account with AppLogs enabled and a Log Profile (docs)

Install

Download the shared library for your platform from the Releases page (out_site24x7-linux-amd64.so, out_site24x7-linux-arm64.so, or out_site24x7-windows-amd64.dll) and place it where Fluent Bit can read it.

Linux:

sudo mkdir -p /usr/lib/fluent-bit/plugins
sudo cp out_site24x7-linux-amd64.so /usr/lib/fluent-bit/plugins/out_site24x7.so

Windows (PowerShell):

Copy-Item out_site24x7-windows-amd64.dll 'C:\fluent-bit\plugins\out_site24x7.dll'

then reference the .dll path in plugins.conf or with -e, exactly as on Linux.

For container deployments, add the plugin on top of the official image:

FROM fluent/fluent-bit:3.1
COPY out_site24x7.so /fluent-bit/lib/out_site24x7.so

Build from source

For other platforms (e.g. Alpine/musl), or to build locally:

git clone https://github.com/site24x7/fluent-bit-plugin-site24x7.git
cd fluent-bit-plugin-site24x7
go mod tidy
make            # produces out_site24x7.so
make test       # runs unit tests
make docker     # optional: local Fluent Bit image with the plugin

Usage

  1. In Site24x7, go to Admin > AppLogs > Log Profile, create a profile with Log Source: Log Collectors, open it, and copy the logTypeConfig string.
  2. Reference the plugin and configure the output:
[OUTPUT]
    Name             site24x7
    Match            *
    log_type_config  <base64 logTypeConfig from Site24x7>
    Retry_Limit      False
  1. Start Fluent Bit with the plugin loaded:
fluent-bit -e /path/to/out_site24x7.so -c fluent-bit.conf

or register it permanently in plugins.conf:

[PLUGINS]
    Path /path/to/out_site24x7.so

A complete example is in examples/fluent-bit.conf.

Configuration parameters

Parameter Required Default Description
log_type_config Yes – Base64 configuration string copied from the Log Profile in the Site24x7 web console. Determines the upload endpoint, API key, log type, parsing (jsonPath or line regex), date format, and masking/hashing/filter rules.
http_proxy No honors HTTP_PROXY/HTTPS_PROXY env Proxy URL, e.g. http://user:pass@proxy:8080.
http_read_timeout No 30 HTTP timeout in seconds for the upload request.
skip_ssl_verify No false When true, disables TLS certificate verification of the upload endpoint. Not recommended — it exposes the API key and log data to on-path attackers. Leave unset (verification on) unless you terminate TLS at a trusted proxy with a private CA.

Retries for transient failures (connection errors, HTTP 5xx) are delegated to the Fluent Bit engine — the plugin returns retry and the engine's scheduler re-delivers the chunk. Control this with the standard Retry_Limit option of the [OUTPUT] section (False = retry forever).

Behavior on Site24x7 4xx responses mirrors the Fluentd plugin: license or upload-limit responses pause uploads for 10 minutes; an invalid account/log type or disabled API upload stops uploads until Fluent Bit is restarted with a fixed configuration.

Record mapping

  • If the Log Type has a jsonPath, each configured field is extracted from the record (dotted keys traverse nested objects; json-object fields are flattened to key/value pairs).
  • If the Log Type has a line regex (plain-text log types), raw lines are parsed by the plugin itself — no Fluent Bit parser needed. Non-matching lines without a timestamp (per the Log Type's dateRegex) are stitched into the previous event's message as stack-trace continuations; an event is shipped once the next entry starts or after 30 seconds.
  • Otherwise the record's fields are uploaded as-is — Fluent Bit parsers and filters can also be used to shape records so field names match the Log Type.
  • If a record is a single unparsed log/message string containing JSON (for a jsonPath log type), it is expanded automatically.
  • The event timestamp is taken from the Log Type's date field (unix, unix_ms, and strptime formats supported); when missing or unparsable, the Fluent Bit record timestamp is used.
  • s247agentuid is set to the host name.
  • The Log Profile's maskingConfig, hashingConfig (SHA-256), derivedConfig, filterConfig, and ignored_fields are applied to each event in that order, matching the Fluentd plugin's behavior. Regexes must be RE2-compatible (no backreferences or lookarounds).

Multiline start/end patterns (ml_regex) from the Log Profile are not implemented — for those log types use Fluent Bit's multiline parsers instead. Timestamp-less continuation lines (stack traces) are already handled by the built-in stitching described above.

Troubleshooting

  • Run Fluent Bit with -v for debug logs; all plugin messages are prefixed with [out_site24x7].
  • 400 with log_license_exceeds / blocked_logtype: account log license or log type limit reached — uploads pause for 10 minutes.
  • 400 with invalid_logtype / invalid_account / api_upload_enabled: False: verify the log_type_config value and that it was copied from the same Site24x7 account/data center.
  • Verify logs arrive under AppLogs in the Site24x7 console by searching for your Log Type.

Related

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages