Movatterモバイル変換


[0]ホーム

URL:


Fluent Bit: Official Manual
Ctrlk
SlackGitHubCommunity MeetingsWebinars
Powered by GitBook
On this page

Check keys and null values

When working with structured messages (also known as records), there are certain cases where you might want to confirm whether a key exists, and whether its value is null or not null.

In Fluent Bit, records are a binary serialization of maps with keys and value. A value can benull, which is a valid data type. The following statements can be applied in Fluent Bit SQL:

Check if a key value is null

The following statement retrieves all records from the streamtest where the keyphone has a value ofnull:

SELECT*FROM STREAM:testWHERE phoneISNULL;

Check if a key value is not null

The following statement is similar to the previous example, but instead retrieves all records from the streamtest where the keyphone has a non-null value:

SELECT*FROM STREAM:testWHERE phoneIS NOT NULL;

Check if a key exists

You can also confirm whether a certain key exists in a record at all, regardless of its value. Fluent Bit provides specific record functions that you can use in the condition part of the SQL statement. The following function determines whetherkey exists in a record:

@record.contains(key)

For example, the following statement retrieves all records that contain a key calledphone:

SELECT*FROM STREAM:testWHERE @record.contains(phone);

Last updated

Was this helpful?


[8]ページ先頭

©2009-2025 Movatter.jp