Skip to content

Commit 5a3a18c

Browse files
agup006gitbook-bot
authored andcommitted
GitBook: [1.6] 4 pages modified
1 parent ca767f9 commit 5a3a18c

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

installation/docker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,4 @@ Alpine Linux uses Musl C library instead of Glibc. Musl is not fully compatible
8484
Our Docker containers images are deployed thousands of times per day, we take security and stability very seriously.
8585

8686
The _latest_ tag _most of the time_ points to the latest stable image. When we release a major update to Fluent Bit like for example from v1.3.x to v1.4.0, we don't move _latest_ tag until 2 weeks after the release. That give us extra time to verify with our community that everything works as expected.
87+

installation/windows.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,4 @@ To halt the Fluent Bit service, just execute the "stop" command.
128128
```text
129129
% sc.exe stop fluent-bit
130130
```
131+

installation/yocto-embedded-linux.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ It's strongly recommended to always use the stable release of Fluent Bit recipe
1414
## Fluent Bit and other architectures
1515

1616
Fluent Bit >= v1.1.x fully supports x86\_64, x86, arm32v7 and arm64v8.
17+

pipeline/inputs/tail.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,64 @@ In your main configuration file append the following _Input_ & _Output_ sections
7979
Match *
8080
```
8181

82+
### Multi-line example
83+
84+
When using multi-line configuration you need to first specify `Multiline On` in the configuration and use the `Parser_Firstline` and additional parser parameters `Parser_N` if needed. If we are trying to read the following Java Stacktrace as a single event
85+
86+
```text
87+
Dec 14 06:41:08 Exception in thread "main" java.lang.RuntimeException: Something has gone wrong, aborting!
88+
at com.myproject.module.MyProject.badMethod(MyProject.java:22)
89+
at com.myproject.module.MyProject.oneMoreMethod(MyProject.java:18)
90+
at com.myproject.module.MyProject.anotherMethod(MyProject.java:14)
91+
at com.myproject.module.MyProject.someMethod(MyProject.java:10)
92+
at com.myproject.module.MyProject.main(MyProject.java:6)
93+
```
94+
95+
We need to specify a `Parser_Firstline` parameter that matches the first line of a multi-line event. Once a match is made Fluent Bit will read all future lines until another match with `Parser_Firstline` is made .
96+
97+
In the case above we can use the following parser, that extracts the Time as `time` and the remaining portion of the multiline as `log`
98+
99+
```text
100+
[PARSER]
101+
Name multiline
102+
Format regex
103+
Regex /(?<time>Dec \d+ \d+\:\d+\:\d+)(?<message>.*)/
104+
Time_Key time
105+
Time_Format %b %d %H:%M:%S
106+
```
107+
108+
If we want to further parse the entire event we can add additional parsers with `Parser_N` where N is an integer. The final Fluent Bit configuration looks like the following:
109+
110+
```text
111+
# Note this is generally added to parsers.conf and referenced in [SERVICE]
112+
[PARSER]
113+
Name multiline
114+
Format regex
115+
Regex /(?<time>Dec \d+ \d+\:\d+\:\d+)(?<message>.*)/
116+
Time_Key time
117+
Time_Format %b %d %H:%M:%S
118+
119+
[INPUT]
120+
Name tail
121+
Multiline On
122+
Parser_Multiline multiline
123+
Path /var/log/java.log
124+
125+
[OUTPUT]
126+
Name stdout
127+
Match *
128+
```
129+
130+
Our output will be as follows.
131+
132+
```text
133+
[0] tail.0: [1607928428.466041977, {"message"=>"Exception in thread "main" java.lang.RuntimeException: Something has gone wrong, aborting!
134+
at com.myproject.module.MyProject.badMethod(MyProject.java:22)
135+
at com.myproject.module.MyProject.oneMoreMethod(MyProject.java:18)
136+
at com.myproject.module.MyProject.anotherMethod(MyProject.java:14)
137+
at com.myproject.module.MyProject.someMethod(MyProject.java:10)", "message"=>"at com.myproject.module.MyProject.main(MyProject.java:6)"}]
138+
```
139+
82140
## Tailing files keeping state <a id="keep_state"></a>
83141

84142
The _tail_ input plugin a feature to save the state of the tracked files, is strongly suggested you enabled this. For this purpose the **db** property is available, e.g:

0 commit comments

Comments
 (0)