fluent-bit には Lua スクリプトでfilterできるプラグインがあります。 これを使うと、下記のようなことができます。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SPDX-License-Identifier: MIT-0 */ | |
/* Based https://www.freedesktop.org/software/systemd/man/sd_journal_next.html */ | |
#include <errno.h> | |
#include <stdio.h> | |
#include <systemd/sd-journal.h> | |
int main(int argc, char *argv[]) { | |
int r; | |
sd_journal *j; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | |
/* Fluent Bit | |
* ========== | |
* Copyright (C) 2019-2021 The Fluent Bit Authors | |
* Copyright (C) 2015-2018 Treasure Data Inc. | |
* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"debug/pe" | |
"fmt" | |
"os" | |
) | |
func main() { | |
file, err := pe.Open(os.Args[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <fluent-bit.h> | |
int main() | |
{ | |
int i; | |
int n; | |
char tmp[256]; | |
flb_ctx_t *ctx; | |
int in_ffd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <fluent-bit.h> | |
int main() | |
{ | |
int i; | |
int n; | |
char tmp[256]; | |
flb_ctx_t *ctx; | |
int in_ffd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <fluent-bit.h> | |
#include <msgpack.h> | |
int my_stdout_json(void* data, size_t size) | |
{ | |
printf("[%s]",__FUNCTION__); | |
printf("%s",(char*)data); | |
printf("\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OS | |
Raspbian on Raspberry Pi 2 | |
# gcc | |
$ gcc --version | |
gcc (Debian 4.6.3-14+rpi1) 4.6.3 | |
Copyright (C) 2011 Free Software Foundation, Inc. | |
This is free software; see the source for copying conditions. There is NO | |
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
NewerOlder