Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

out_calyptia: register OS and architecture for agents. #8466

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions plugins/out_calyptia/calyptia.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,52 @@ static flb_sds_t get_agent_metadata(struct flb_calyptia *ctx)
msgpack_pack_str(&mp_pck, 9);
msgpack_pack_str_body(&mp_pck, "community", 9);

flb_mp_map_header_append(&mh);
msgpack_pack_str(&mp_pck, 2);
msgpack_pack_str_body(&mp_pck, "os", 2);
#ifdef FLB_SYSTEM_WINDOWS
len = strlen("windows");
msgpack_pack_str(&mp_pck, len);
msgpack_pack_str_body(&mp_pck, "windows", len);
#elif FLB_SYSTEM_MACOS
len = strlen("macos");
msgpack_pack_str(&mp_pck, len);
msgpack_pack_str_body(&mp_pck, "macos", len);
#elif __linux__
len = strlen("linux");
msgpack_pack_str(&mp_pck, len);
msgpack_pack_str_body(&mp_pck, "linux", len);
#else
len = strlen("unknown");
msgpack_pack_str(&mp_pck, len);
msgpack_pack_str_body(&mp_pck, "unknown", len);
#endif

flb_mp_map_header_append(&mh);
msgpack_pack_str(&mp_pck, 4);
msgpack_pack_str_body(&mp_pck, "arch", 4);
#if defined(__arm__) || defined(_M_ARM)
len = strlen("arm");
msgpack_pack_str(&mp_pck, len);
msgpack_pack_str_body(&mp_pck, "arm", len);
#elif defined(__aarch64__)
len = strlen("arm64");
msgpack_pack_str(&mp_pck, len);
msgpack_pack_str_body(&mp_pck, "arm64", len);
#elif defined(__amd64__) || defined(_M_AMD64)
len = strlen("x86_64");
msgpack_pack_str(&mp_pck, len);
msgpack_pack_str_body(&mp_pck, "x86_64", len);
#elif defined(__i686__) || defined(_M_I86)
len = strlen("x86");
msgpack_pack_str(&mp_pck, len);
msgpack_pack_str_body(&mp_pck, "x86", len);
#else
len = strlen("unknown");
msgpack_pack_str(&mp_pck, len);
msgpack_pack_str_body(&mp_pck, "unknown", len);
#endif

/* machineID */
flb_mp_map_header_append(&mh);
msgpack_pack_str(&mp_pck, 9);
Expand Down
Loading