Skip to content

Instantly share code, notes, and snippets.

@jharley
Created November 2, 2021 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jharley/6fbcb6125a15ec7bdabe1f395c885b63 to your computer and use it in GitHub Desktop.
Save jharley/6fbcb6125a15ec7bdabe1f395c885b63 to your computer and use it in GitHub Desktop.
fluent-bit to Honeycomb.io Events API
[INPUT]
Name dummy
[FILTER]
Name lua
Match *
script hny_event_filter.lua
call hny_format_filter
[OUTPUT]
# honeycomb.io
Name http
Match *
Host api.honeycomb.io
Port 443
TLS on
# needed on macOS via brew
#TLS.ca_file /usr/local/Cellar/ca-certificates/2021-10-26/share/ca-certificates/cacert.pem
URI /1/batch/logging-poc
Format json
json_date_key false
Header X-Honeycomb-Team ${HONEYCOMB_API_KEY}
function hny_format_filter(tag, timestamp, record)
new_record = {}
new_record["data"] = record
new_record["time"] = os.date("!%Y-%m-%dT%T", timestamp)
return 1, timestamp, new_record
end
@jharley
Copy link
Author

jharley commented Nov 2, 2021

$ fluent-bit -c fluent-bit.conf
Fluent Bit v1.8.8
* Copyright (C) 2019-2021 The Fluent Bit Authors
* Copyright (C) 2015-2018 Treasure Data
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

[2021/11/02 16:39:51] [ info] [engine] started (pid=72429)
[2021/11/02 16:39:51] [ info] [storage] version=1.1.4, initializing...
[2021/11/02 16:39:51] [ info] [storage] in-memory
[2021/11/02 16:39:51] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
[2021/11/02 16:39:51] [ info] [cmetrics] version=0.2.2
[2021/11/02 16:39:51] [ info] [sp] stream processor started
[2021/11/02 20:39:57] [ info] [output:http:http.0] api.honeycomb.io:443, HTTP status=200
[{"status":202},{"status":202},{"status":202},{"status":202}]

[2021/11/02 20:40:01] [ info] [output:http:http.0] api.honeycomb.io:443, HTTP status=200
[{"status":202},{"status":202},{"status":202},{"status":202},{"status":202}]

[2021/11/02 20:40:06] [ info] [output:http:http.0] api.honeycomb.io:443, HTTP status=200
[{"status":202},{"status":202},{"status":202},{"status":202},{"status":202}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment