Skip to content

A fluent bit output plugin to check if the key/value contains expected key/value

License

Notifications You must be signed in to change notification settings

nokute78/fluentbit-plugin-out-expect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fluent-bit-plugin-out-expect

Go Go Report Card Go Reference Ouput plugin for Fluent-Bit to verify key/value of record.

Feature

  • Conditional checking
  • Nested field support

Configuration Parameters

Each configuration name should be key_nameN. N is 0-15.

Key Exists

key_existsN Json Object or key_not_existsN Json Object

Json object:

Key Value Type Description
"key" string or string array The key name to check if it exists or not. If it is array, it is recognized as nested keys.

Example:

use case example configuration
Key "alert" should be exist key_exist0 {"key":"alert"}
Key "alert" should not be exist key_not_exist0 {"key":"alert"}

Boolean

key_boolN Json Object

Json object:

Key Value Type Description
"key" string or string array The key name to check if it exists or not. If it is array, it is recognized as nested keys.
"value" boolean Checking value.
"condition" string Checking Condition. "=="/"!="

Example:

use case example configuration
Value of key "not_nil" should be true key_bool0 {"key":"not_nil","condition","==", "value":true}
Value of key "not_nil" should be false key_bool0 {"key":"not_nil","condition","contains", "value":false}

String

key_strN Json Object

Json object:

Key Value Type Description
"key" string or string array The key name to check if it exists or not. If it is array, it is recognized as nested keys.
"value" string Checking value.
"condition" string Checking Condition. "=="/"!="/"contains"/"not_contains"

Example:

use case example configuration
Value of key "name" should be match "Taro" key_str0 {"key":"name","condition","==", "value":"taro"}
Value of key "name" should be contain "Taro" key_str0 {"key":"name","condition","contains", "value":"taro"}

Int

key_intN Json Object

Json object:

Key Value Type Description
"key" string or string array The key name to check if it exists or not. If it is array, it is recognized as nested keys.
"value" int Checking value.
"condition" string Checking Condition. "=="/"!="/">"/">="/"<"/"<="

Example:

use case example configuration
Value of key "log_level" should be match 3 key_int0 {"key":"log_level","condition","==", "value":3}
Value of key "log_level" should be greater than 3 key_int0 {"key":"log_level","condition",">", "value":3}

Uint

key_uintN Json Object

Json object:

Key Value Type Description
"key" string or string array The key name to check if it exists or not. If it is array, it is recognized as nested keys.
"value" uint Checking value.
"condition" string Checking Condition. "=="/"!="/">"/">="/"<"/"<="

Example:

use case example configuration
Value of key "log_level" should be match 3 key_uint0 {"key":"log_level","condition","==", "value":3}
Value of key "log_level" should be greater than 3 key_uint0 {"key":"log_level","condition",">", "value":3}

Double

key_doubleN Json Object

Json object:

Key Value Type Description
"key" string or string array The key name to check if it exists or not. If it is array, it is recognized as nested keys.
"value" double Checking value.
"condition" string Checking Condition. "=="/"!="/">"/">="/"<"/"<="

Example:

use case example configuration
Value of key "degree" should be match 27.3 key_double0 {"key":"degree","condition","==", "value":27.3}
Value of key "degree" should be greater than 27.3 key_double0 {"key":"degree","condition",">", "value":27.3}

Build

make

License

Apache License v2.0

About

A fluent bit output plugin to check if the key/value contains expected key/value

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published