Hi Eduardo,
Thank you. I got it working as follows:
(complete examples:
https://github.com/amitsaha/webapp-exp/tree/master/logging/fluent-bit-streaming)
# fluent-bit conf
[SERVICE]
Flush 1
Log_Level info
Parsers_file parsers.conf
Streams_File stream_processor.conf
[INPUT]
Name Tail
Path ./sample.log
Parser json
routable off
[OUTPUT]
Name null
Match type2
[OUTPUT]
Name stdout
Match type1
# stream-processor.conf
[STREAM_TASK]
Name example
Exec CREATE STREAM payloads WITH(tag='type1') AS SELECT * FROM
STREAM:tail.0 WHERE @record.contains(request_body);
[STREAM_TASK]
Name example1
Exec CREATE STREAM nopayloads WITH(tag='type2') AS SELECT * FROM
STREAM:tail.0 WHERE NOT @record.contains(request_body);
# sample.log
{"date": "22/abr/2019:12:43:51 -0600", "ip": "73.113.230.135", "word":
"balsamine", "country": "Japan", "flag": false, "num": 96}
{"date": "22/abr/2019:12:43:52 -0600", "ip": "242.212.128.227",
"word": "inappendiculate", "country": "Chile", "flag": false, "num":
15}
{"date": "22/abr/2019:12:43:52 -0600", "ip": "85.61.182.212", "word":
"elicits", "country": "Argentina", "flag": true, "num": 73}
{"date": "22/abr/2019:12:43:52 -0600", "ip": "124.192.66.23", "word":
"Dwan", "country": "Germany", "flag": false, "num": 67}
{"date": "22/abr/2019:12:43:52 -0600", "ip": "18.135.244.142", "word":
"chesil", "country": "Argentina", "flag": true, "num": 19,
"request_body": "foo"}
When fluent bit is run, we only see:
{"date": "22/abr/2019:12:43:52 -0600", "ip": "18.135.244.142", "word":
"chesil", "country": "Argentina", "flag": true, "num": 19,
"request_body": "foo"}
Is the way I am defining the `STREAM_TASK` the right way to do it when
there are multiple Exec statements?
Thanks,
Amit.
--
http://echorand.me