Fluent Bit Stream Processor: conditionals and quering sub-maps / nested keys

by edsiper
GNU/Linux ◆ xterm-256color ◆ bash 963 views

Our Stream Processor on GIT master branch already got support to query key values that are in nested maps.

Consider the following records:

{"log": {"labels": {"color": "blue", "num": 100}}}
{"log": {"labels": {"color": "red" , "num": 200}}}

you can access sub-keys using braces, if you want to access the value of color you can do it with:

log['labels']['color']

in a SQL statement, if you want to retrieve all records where color is blue, it can be translated to:

SELECT * FROM STREAM:data WHERE log['labels']['color'] = 'blue';