You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pipeline/inputs/head.md
+47-46Lines changed: 47 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,9 +41,31 @@ siblings : 1
41
41
The CPU frequency is `cpu MHz : 2791.009`. The following configuration file gets the needed line:
42
42
43
43
{% 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 %}
44
66
{% tab title="fluent-bit.conf" %}
45
67
46
-
```python
68
+
```text
47
69
[INPUT]
48
70
Name head
49
71
Tag head.cpu
@@ -62,34 +84,13 @@ The CPU frequency is `cpu MHz : 2791.009`. The following configuration file gets
62
84
Match *
63
85
```
64
86
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
-
86
87
{% endtab %}
87
88
{% endtabs %}
88
89
89
90
If you run the following command:
90
91
91
-
```bash
92
-
bin/fluent-bit -c head.conf
92
+
```shell
93
+
$ fluent-bit -c head.conf
93
94
```
94
95
95
96
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
116
117
117
118
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:
0 commit comments