Skip to content

Commit

Permalink
GitBook: [master] one page modified
Browse files Browse the repository at this point in the history
  • Loading branch information
agup006 authored and gitbook-bot committed Jul 26, 2021
1 parent 1cae690 commit 04de308
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions stream-processing/getting-started/hands-on.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For all next steps we will run Fluent Bit from the command line, and for simplic

```bash
$ docker run -ti fluent/fluent-bit:1.4 /fluent-bit/bin/fluent-bit --version
Fluent Bit v1.4.0
Fluent Bit v1.8.2
```

### 2. Parse sample files
Expand All @@ -30,18 +30,19 @@ The samples file contains JSON records. On this command, we are appending the Pa

```bash
$ docker run -ti -v `pwd`/sp-samples-1k.log:/sp-samples-1k.log \
fluent/fluent-bit:1.4 \
fluent/fluent-bit:1.8.2 \
/fluent-bit/bin/fluent-bit -R /fluent-bit/etc/parsers.conf \
-i tail -p path=/sp-samples-1k.log \
-p parser=json \
-p read_from_head=true \
-o stdout -f 1
```

The command above will simply print the parsed content to the standard output interface. The content will print the _Tag_ associated to each record and an array with two fields: record timestamp and record map:

```text
Fluent Bit v1.4.0
* Copyright (C) 2019-2020 The Fluent Bit Authors
Fluent Bit v1.8.2
* Copyright (C) 2019-2021 The Fluent Bit Authors
* Copyright (C) 2015-2018 Treasure Data
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
Expand Down Expand Up @@ -73,6 +74,7 @@ $ docker run -ti -v `pwd`/sp-samples-1k.log:/sp-samples-1k.log \
-i tail \
-p path=/sp-samples-1k.log \
-p parser=json \
-p read_from_head=true \
-T "SELECT word, num FROM STREAM:tail.0 WHERE country='Chile';" \
-o null -f 1
```
Expand All @@ -93,7 +95,7 @@ The following query is similar to the one in the previous step, but this time we

```bash
$ docker run -ti -v `pwd`/sp-samples-1k.log:/sp-samples-1k.log \
fluent/fluent-bit:1.2 \
fluent/fluent-bit:1.8.2 \
/fluent-bit/bin/fluent-bit \
-R /fluent-bit/etc/parsers.conf \
-i tail \
Expand Down Expand Up @@ -121,7 +123,7 @@ Grouping results aims to simplify data processing and when used in a defined win

```bash
$ docker run -ti -v `pwd`/sp-samples-1k.log:/sp-samples-1k.log \
fluent/fluent-bit:1.2 \
fluent/fluent-bit:1.8.2 \
/fluent-bit/bin/fluent-bit \
-R /fluent-bit/etc/parsers.conf \
-i tail \
Expand All @@ -148,12 +150,13 @@ This can be done using the **CREATE STREAM** statement that will also tag result

```bash
$ docker run -ti -v `pwd`/sp-samples-1k.log:/sp-samples-1k.log \
fluent/fluent-bit:1.2 \
fluent/fluent-bit:1.8.2 \
/fluent-bit/bin/fluent-bit \
-R /fluent-bit/etc/parsers.conf \
-i tail \
-p path=/sp-samples-1k.log \
-p parser=json \
-p read_from_head=true \
-T "CREATE STREAM results WITH (tag='sp-results') \
AS \
SELECT country, AVG(num) FROM STREAM:tail.0 \
Expand All @@ -177,12 +180,13 @@ Fluent Bit have the notion of streams, and every input plugin instance gets a de

```bash
$ docker run -ti -v `pwd`/sp-samples-1k.log:/sp-samples-1k.log \
fluent/fluent-bit:1.4 \
fluent/fluent-bit:1.8.2 \
/fluent-bit/bin/fluent-bit \
-R /fluent-bit/etc/parsers.conf \
-i tail \
-p path=/sp-samples-1k.log \
-p parser=json \
-p read_from_head=true \
-p alias=samples \
-T "CREATE STREAM results WITH (tag='sp-results') \
AS \
Expand Down

0 comments on commit 04de308

Please sign in to comment.