Skip to content

Commit e99b1bc

Browse files
authored
Fixes for YAML defaults and shell usage. Fixes #1805. (#1806)
Signed-off-by: Eric D. Schabell <[email protected]>
1 parent 91f88a9 commit e99b1bc

File tree

1 file changed

+47
-46
lines changed

1 file changed

+47
-46
lines changed

pipeline/inputs/head.md

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,31 @@ siblings : 1
4141
The CPU frequency is `cpu MHz : 2791.009`. The following configuration file gets the needed line:
4242

4343
{% tabs %}
44+
{% tab title="fluent-bit.yaml" %}
45+
46+
```yaml
47+
pipeline:
48+
inputs:
49+
- name: head
50+
tag: head.cpu
51+
file: /proc/cpuinfo
52+
lines: 8
53+
split_line: true
54+
55+
filters:
56+
- name: record_modifier
57+
match: '*'
58+
whitelist_key: line7
59+
60+
outputs:
61+
- name: stdout
62+
match: '*'
63+
```
64+
65+
{% endtab %}
4466
{% tab title="fluent-bit.conf" %}
4567
46-
```python
68+
```text
4769
[INPUT]
4870
Name head
4971
Tag head.cpu
@@ -62,34 +84,13 @@ The CPU frequency is `cpu MHz : 2791.009`. The following configuration file gets
6284
Match *
6385
```
6486

65-
{% endtab %}
66-
67-
{% tab title="fluent-bit.yaml" %}
68-
69-
```yaml
70-
pipeline:
71-
inputs:
72-
- name: head
73-
tag: head.cpu
74-
file: /proc/cpuinfo
75-
lines: 8
76-
split_line: true
77-
filters:
78-
- name: record_modifier
79-
match: '*'
80-
whitelist_key: line7
81-
outputs:
82-
- name: stdout
83-
match: '*'
84-
```
85-
8687
{% endtab %}
8788
{% endtabs %}
8889

8990
If you run the following command:
9091

91-
```bash
92-
bin/fluent-bit -c head.conf
92+
```shell
93+
$ fluent-bit -c head.conf
9394
```
9495

9596
The output is something similar to;
@@ -116,8 +117,8 @@ To read the head of a file, you can run the plugin from the command line or thro
116117

117118
The following example will read events from the `/proc/uptime` file, tag the records with the `uptime` name and flush them back to the `stdout` plugin:
118119

119-
```bash
120-
fluent-bit -i head -t uptime -p File=/proc/uptime -o stdout -m '*'
120+
```shell
121+
$ fluent-bit -i head -t uptime -p File=/proc/uptime -o stdout -m '*'
121122
```
122123

123124
The output will look similar to:
@@ -138,27 +139,9 @@ Fluent Bit v1.x.x
138139

139140
### Configuration file
140141

141-
In your main configuration file append the following `Input` and `Output` sections:
142+
In your main configuration file append the following:
142143

143144
{% tabs %}
144-
{% tab title="fluent-bit.conf" %}
145-
146-
```python
147-
[INPUT]
148-
Name head
149-
Tag uptime
150-
File /proc/uptime
151-
Buf_Size 256
152-
Interval_Sec 1
153-
Interval_NSec 0
154-
155-
[OUTPUT]
156-
Name stdout
157-
Match *
158-
```
159-
160-
{% endtab %}
161-
162145
{% tab title="fluent-bit.yaml" %}
163146

164147
```yaml
@@ -170,16 +153,34 @@ pipeline:
170153
buf_size: 256
171154
interval_sec: 1
172155
interval_nsec: 0
156+
173157
outputs:
174158
- name: stdout
175159
match: '*'
176160
```
177161
162+
{% endtab %}
163+
{% tab title="fluent-bit.conf" %}
164+
165+
```shell
166+
[INPUT]
167+
Name head
168+
Tag uptime
169+
File /proc/uptime
170+
Buf_Size 256
171+
Interval_Sec 1
172+
Interval_NSec 0
173+
174+
[OUTPUT]
175+
Name stdout
176+
Match *
177+
```
178+
178179
{% endtab %}
179180
{% endtabs %}
180181

181182
The interval is calculated like this:
182183

183184
`Total interval (sec) = Interval_Sec + (Interval_Nsec / 1000000000)`.
184185

185-
For example: `1.5s = 1s + 500000000ns`.
186+
For example: `1.5s = 1s + 500000000ns`.

0 commit comments

Comments
 (0)