Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/fluent/fluent-bit into ot…
Browse files Browse the repository at this point in the history
…elsat
  • Loading branch information
andyatwork committed Dec 7, 2024
2 parents e13e4cd + 412d3ea commit f149da7
Show file tree
Hide file tree
Showing 1,506 changed files with 18,646 additions and 100,918 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
config:
- name: "Aarch64 actuated testing"
flb_option: "-DFLB_WITHOUT_flb-it-network=1 -DFLB_WITHOUT_flb-it-fstore=1"
omit_option: "-DFLB_WITHOUT_flb-it-utils=1 -DFLB_WITHOUT_flb-it-pack=1"
omit_option: ""
global_option: "-DFLB_BACKTRACE=Off -DFLB_SHARED_LIB=Off -DFLB_DEBUG=On -DFLB_ALL=On -DFLB_EXAMPLES=Off"
unit_test_option: "-DFLB_TESTS_INTERNAL=On"
compiler: gcc
Expand Down
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
# Fluent Bit Version
set(FLB_VERSION_MAJOR 3)
set(FLB_VERSION_MINOR 2)
set(FLB_VERSION_PATCH 0)
set(FLB_VERSION_PATCH 3)
set(FLB_VERSION_STR "${FLB_VERSION_MAJOR}.${FLB_VERSION_MINOR}.${FLB_VERSION_PATCH}")

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand All @@ -30,6 +30,10 @@ endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(FLB_SYSTEM_LINUX On)
add_definitions(-DFLB_SYSTEM_LINUX)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)")
set(FLB_LINUX_ON_AARCH64 On)
add_definitions(-DFLB_LINUX_ON_AARCH64)
endif()
endif()

# Update CFLAGS
Expand Down Expand Up @@ -256,6 +260,8 @@ if(FLB_ALL)
endif()

if(FLB_DEV)
FLB_DEFINITION(FLB_HAVE_DEV)

set(FLB_DEBUG On)
set(FLB_TRACE On)
set(FLB_CHUNK_TRACE On)
Expand Down Expand Up @@ -315,6 +321,12 @@ if (FLB_SYSTEM_LINUX)
include(cmake/s390x.cmake)
endif ()

# Enable signed char support on Linux AARCH64 if specified
if (FLB_LINUX_ON_AARCH64)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
message(STATUS "Enabling signed char")
endif()

# Extract Git commit information for debug output.
# Note that this is only set when cmake is run, the intent here is to use in CI for verification of releases so is acceptable.
# For a better solution see https://jonathanhamberg.com/post/cmake-embedding-git-hash/ but this is simple and easy.
Expand Down
8 changes: 5 additions & 3 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
# Devcontainer
/.devcontainer @patrick-stephens @niedbalski @edsiper

# Calytia Fleet
/plugins/custom_calyptia/ @pwhelan
/plugins/in_calyptia_fleet/ @pwhelan
# Calyptia Fleet
/include/fluent-bit/calyptia/ @pwhelan @patrick-stephens @niedbalski
/plugins/custom_calyptia/ @pwhelan @patrick-stephens @niedbalski
/plugins/custom_calyptia/ @pwhelan @patrick-stephens @niedbalski
/plugins/out_calyptia/ @pwhelan @patrick-stephens @niedbalski
7 changes: 4 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@


| Version | Supported |
| ------- | ------------------ |
| 3.x | :white_check_mark: |
| < 3.0 | :x: |
|---------| ------------------ |
| 3.2.x | :white_check_mark: |
| 3.1.x | :white_check_mark: |
| < 3.1 | :x: |

## Reporting a Vulnerability

Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Vagrant.configure("2") do |config|
# Main build
apt-get install --yes build-essential cmake dh-make git make openssl pkg-config tar
# Dependencies
apt-get install --yes libssl3 libssl-dev libsasl2-dev pkg-config libsystemd-dev zlib1g-dev libpq-dev postgresql-server-dev-all flex bison libyaml-dev libpq5
apt-get install --yes libssl3 libssl-dev libsasl2-dev pkg-config libsystemd-dev zlib1g-dev libpq-dev postgresql-server-dev-all flex bison libyaml-dev libpq5 libbpf-dev
# Debug
apt-get install --yes gdb valgrind
Expand Down
2 changes: 1 addition & 1 deletion cmake/libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ set(FLB_PATH_LIB_CARES "lib/c-ares-1.33.1")
set(FLB_PATH_LIB_SNAPPY "lib/snappy-fef67ac")
set(FLB_PATH_LIB_RDKAFKA "lib/librdkafka-2.4.0")
set(FLB_PATH_LIB_RING_BUFFER "lib/lwrb")
set(FLB_PATH_LIB_WASM_MICRO_RUNTIME "lib/wasm-micro-runtime-WAMR-1.3.0")
set(FLB_PATH_LIB_WASM_MICRO_RUNTIME "lib/wasm-micro-runtime-WAMR-1.3.3")
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7,linux/s390x" -f ./dockerfiles/Dockerfile.multiarch --build-arg FLB_TARBALL=https://github.com/fluent/fluent-bit/archive/v1.8.11.tar.gz ./dockerfiles/

# Set this to the current release version: it gets done so as part of the release.
ARG RELEASE_VERSION=3.2.0
ARG RELEASE_VERSION=3.2.3

# For multi-arch builds - assumption is running on an AMD64 host
FROM multiarch/qemu-user-static:x86_64-arm AS qemu-arm32
Expand Down
2 changes: 1 addition & 1 deletion fluent-bit-3.2.0.bb → fluent-bit-3.2.3.bb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
SECTION = "net"

PR = "r0"
PV = "3.2.0"
PV = "3.2.3"

SRCREV = "v${PV}"
SRC_URI = "git://github.com/fluent/fluent-bit.git;nobranch=1"
Expand Down
6 changes: 6 additions & 0 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ install(FILES ${headers}
COMPONENT headers
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)

file(GLOB headers "fluent-bit/calyptia/*.h")
install(FILES ${headers}
DESTINATION ${FLB_INSTALL_INCLUDEDIR}/fluent-bit
COMPONENT headers
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)

file(GLOB headers "fluent-bit/config_format/*.h")
install(FILES ${headers}
DESTINATION ${FLB_INSTALL_INCLUDEDIR}/fluent-bit/config_format/
Expand Down
68 changes: 68 additions & 0 deletions include/fluent-bit/calyptia/calyptia_constants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/* Fluent Bit
* ==========
* Copyright (C) 2015-2024 The Fluent Bit Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FLB_CALYPTIA_CONSTANTS_H
#define FLB_CALYPTIA_CONSTANTS_H

/* End point */
#define DEFAULT_CALYPTIA_HOST "cloud-api.calyptia.com"
#define DEFAULT_CALYPTIA_PORT "443"

/* HTTP action types */
#define CALYPTIA_ACTION_REGISTER 0
#define CALYPTIA_ACTION_PATCH 1
#define CALYPTIA_ACTION_METRICS 2
#define CALYPTIA_ACTION_TRACE 3

/* Endpoints */
#define CALYPTIA_ENDPOINT_CREATE "/v1/agents"
#define CALYPTIA_ENDPOINT_PATCH "/v1/agents/%s"
#define CALYPTIA_ENDPOINT_METRICS "/v1/agents/%s/metrics"
#define CALYPTIA_ENDPOINT_TRACE "/v1/traces/%s"

#define CALYPTIA_ENDPOINT_FLEETS "/v1/fleets"
#define CALYPTIA_ENDPOINT_FLEET_CONFIG_INI "/v1/fleets/%s/config?format=ini"
#define CALYPTIA_ENDPOINT_FLEET_FILES "/v1/fleets/%s/files"

/* Storage */
#define CALYPTIA_SESSION_FILE "session.CALYPTIA"

/* Headers */
#define CALYPTIA_HEADERS_PROJECT "X-Project-Token"
#define CALYPTIA_HEADERS_AGENT_TOKEN "X-Agent-Token"
#define CALYPTIA_HEADERS_CTYPE "Content-Type"
#define CALYPTIA_HEADERS_CTYPE_JSON "application/json"
#define CALYPTIA_HEADERS_CTYPE_MSGPACK "application/x-msgpack"

#ifndef FLB_SYSTEM_WINDOWS
#define FLEET_DEFAULT_CONFIG_DIR "/tmp/calyptia-fleet"
#else
#define FLEET_DEFAULT_CONFIG_DIR NULL
#endif

#ifndef PATH_SEPARATOR
#ifndef FLB_SYSTEM_WINDOWS
#define PATH_SEPARATOR "/"
#else
#define PATH_SEPARATOR "\\"
#endif
#endif /* PATH_SEPARATOR */

#define CALYPTIA_MAX_DIR_SIZE 4096

#endif /* FLB_CALYPTIA_CONSTANTS_H */
74 changes: 74 additions & 0 deletions include/fluent-bit/flb_cfl_ra_key.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/* Fluent Bit
* ==========
* Copyright (C) 2015-2024 The Fluent Bit Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef FLB_CFL_RA_KEY_H
#define FLB_CFL_RA_KEY_H

#include <fluent-bit/flb_info.h>
#include <fluent-bit/flb_sds.h>
#include <fluent-bit/flb_regex.h>
#include <fluent-bit/record_accessor/flb_ra_parser.h>
#include <monkey/mk_core.h>
#include <cfl/cfl.h>

#include <stdbool.h>

enum cfl_ra_types {
FLB_CFL_RA_BOOL = 0,
FLB_CFL_RA_INT,
FLB_CFL_RA_FLOAT,
FLB_CFL_RA_STRING,
FLB_CFL_RA_NULL
};

/* condition value types */
typedef union {
bool boolean;
int64_t i64;
double f64;
flb_sds_t string;
} cfl_ra_val;

/* Represent any value object */
struct flb_cfl_ra_value {
int type;
struct cfl_variant v;
cfl_ra_val val;
};

struct flb_cfl_ra_value *flb_cfl_ra_key_to_value(flb_sds_t ckey,
struct cfl_variant vobj,
struct mk_list *subkeys);
void flb_cfl_ra_key_value_destroy(struct flb_cfl_ra_value *v);

int flb_cfl_ra_key_value_get(flb_sds_t ckey, struct cfl_variant vobj,
struct mk_list *subkeys,
cfl_sds_t *start_key,
cfl_sds_t *out_key, struct cfl_variant **out_val);

int flb_cfl_ra_key_strcmp(flb_sds_t ckey, struct cfl_variant vobj,
struct mk_list *subkeys, char *str, int len);
int flb_cfl_ra_key_regex_match(flb_sds_t ckey, struct cfl_variant vobj,
struct mk_list *subkeys, struct flb_regex *regex,
struct flb_regex_search *result);
int flb_cfl_ra_key_value_append(struct flb_ra_parser *rp, struct cfl_variant *vobj,
struct cfl_variant *in_val);
int flb_cfl_ra_key_value_update(struct flb_ra_parser *rp, struct cfl_variant *vobj,
cfl_sds_t in_key, struct cfl_variant *in_val);
#endif
64 changes: 64 additions & 0 deletions include/fluent-bit/flb_cfl_record_accessor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/* Fluent Bit
* ==========
* Copyright (C) 2015-2024 The Fluent Bit Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef FLB_CFL_RECORD_ACCESSOR_H
#define FLB_CFL_RECORD_ACCESSOR_H

#include <fluent-bit/flb_info.h>
#include <fluent-bit/flb_regex.h>
#include <fluent-bit/flb_sds.h>
#include <fluent-bit/flb_sds_list.h>
#include <monkey/mk_core.h>
#include <cfl/cfl.h>

struct flb_cfl_record_accessor {
size_t size_hint;
flb_sds_t pattern;
struct mk_list list; /* List of parsed strings */
struct mk_list _head; /* Head to custom list (only used by flb_mp.h) */
};
void flb_cfl_ra_destroy(struct flb_cfl_record_accessor *cra);
int flb_cfl_ra_subkey_count(struct flb_cfl_record_accessor *cra);
struct flb_cfl_record_accessor *flb_cfl_ra_create(char *str, int translate_env);
flb_sds_t flb_cfl_ra_create_str_from_list(struct flb_sds_list *str_list);
struct flb_cfl_record_accessor *flb_cfl_ra_create_from_list(struct flb_sds_list *str_list, int translate_env);
flb_sds_t flb_cfl_ra_translate(struct flb_cfl_record_accessor *cra,
char *tag, int tag_len,
struct cfl_variant var, struct flb_regex_search *result);
flb_sds_t flb_cfl_ra_translate_check(struct flb_cfl_record_accessor *cra,
char *tag, int tag_len,
struct cfl_variant var, struct flb_regex_search *result,
int check);
void flb_cfl_ra_dump(struct flb_cfl_record_accessor *cra);
int flb_cfl_ra_is_static(struct flb_cfl_record_accessor *cra);
int flb_cfl_ra_strcmp(struct flb_cfl_record_accessor *ra, struct cfl_variant var,
char *str, int len);
int flb_cfl_ra_regex_match(struct flb_cfl_record_accessor *cra, struct cfl_variant var,
struct flb_regex *regex, struct flb_regex_search *result);
int flb_cfl_ra_get_kv_pair(struct flb_cfl_record_accessor *ra,
struct cfl_variant var,
cfl_sds_t *start_key,
cfl_sds_t *out_key, struct cfl_variant **out_val);
struct flb_cfl_ra_value *flb_cfl_ra_get_value_object(struct flb_cfl_record_accessor *cra,
struct cfl_variant var);
int flb_cfl_ra_update_kv_pair(struct flb_cfl_record_accessor *cra, struct cfl_variant var,
cfl_sds_t in_key, struct cfl_variant *in_val);
int flb_cfl_ra_append_kv_pair(struct flb_cfl_record_accessor *cra, struct cfl_variant var,
struct cfl_variant *in_val);
#endif
Loading

0 comments on commit f149da7

Please sign in to comment.