Skip to content

Commit bc33e7f

Browse files
authored
Merge pull request #1121 from onecer/feat_gen_doc_make_dirs
auto gen plugins documentation directory
2 parents 9f50331 + 32263e9 commit bc33e7f

File tree

6 files changed

+101
-1
lines changed

6 files changed

+101
-1
lines changed

cmd/doc-gen/main.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ func plugins(docsLocations []DocumentsLocation) {
130130
}
131131

132132
dst := fmt.Sprintf("./docs/plugins/%s/%s.md", dl.name, src_name)
133+
134+
if err := genDocDirs(dst); err != nil {
135+
fmt.Printf("Error while generating documentation directories: %s\n", err.Error())
136+
}
137+
133138
f, err := os.Create(dst)
134139
if err != nil {
135140
fmt.Printf("Error while generating documentation: %s\n", err.Error())
@@ -183,12 +188,20 @@ func crds(docsLocations []DocumentsLocation) {
183188
buffer.WriteString("[Back to TOC](#table-of-contents)\n")
184189
}
185190
}
186-
191+
187192
f, _ := os.Create(fmt.Sprintf("./docs/%s.md", dl.name))
188193
f.WriteString(fmt.Sprintf(firstParagraph, dl.name) + buffer.String())
189194
}
190195
}
191196

197+
func genDocDirs(docPath string) error {
198+
dirPath := filepath.Dir(docPath)
199+
if _, err := os.Stat(dirPath); os.IsNotExist(err) {
200+
return os.MkdirAll(dirPath, os.ModePerm)
201+
}
202+
return nil
203+
}
204+
192205
func toSectionLink(name string) string {
193206
name = strings.ToLower(name)
194207
name = strings.Replace(name, " ", "-", -1)

docs/fluentbit.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ This Document documents the types introduced by the fluentbit Operator.
88
* [ClusterFluentBitConfigList](#clusterfluentbitconfiglist)
99
* [ClusterInput](#clusterinput)
1010
* [ClusterInputList](#clusterinputlist)
11+
* [ClusterMultilineParser](#clustermultilineparser)
12+
* [ClusterMultilineParserList](#clustermultilineparserlist)
1113
* [ClusterOutput](#clusteroutput)
1214
* [ClusterOutputList](#clusteroutputlist)
1315
* [ClusterParser](#clusterparser)
@@ -29,6 +31,8 @@ This Document documents the types introduced by the fluentbit Operator.
2931
* [FluentBitService](#fluentbitservice)
3032
* [FluentBitSpec](#fluentbitspec)
3133
* [InputSpec](#inputspec)
34+
* [MultilineParser](#multilineparser)
35+
* [MultilineParserList](#multilineparserlist)
3236
* [NamespacedFluentBitCfgSpec](#namespacedfluentbitcfgspec)
3337
* [Output](#output)
3438
* [OutputList](#outputlist)
@@ -104,6 +108,28 @@ ClusterInputList contains a list of ClusterInput
104108
| metadata | | [metav1.ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#listmeta-v1-meta) |
105109
| items | | []ClusterInput |
106110

111+
[Back to TOC](#table-of-contents)
112+
# ClusterMultilineParser
113+
114+
ClusterMultilineParser is the Schema for the cluster-level multiline parser API
115+
116+
117+
| Field | Description | Scheme |
118+
| ----- | ----------- | ------ |
119+
| metadata | | [metav1.ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#objectmeta-v1-meta) |
120+
| spec | | MultilineParserSpec |
121+
122+
[Back to TOC](#table-of-contents)
123+
# ClusterMultilineParserList
124+
125+
ClusterMultilineParserList contains a list of ClusterMultilineParser
126+
127+
128+
| Field | Description | Scheme |
129+
| ----- | ----------- | ------ |
130+
| metadata | | [metav1.ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#listmeta-v1-meta) |
131+
| items | | []ClusterMultilineParser |
132+
107133
[Back to TOC](#table-of-contents)
108134
# ClusterOutput
109135

@@ -331,6 +357,7 @@ FluentBitConfigSpec defines the desired state of ClusterFluentBitConfig
331357
| filterSelector | Select filter plugins | [metav1.LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#labelselector-v1-meta) |
332358
| outputSelector | Select output plugins | [metav1.LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#labelselector-v1-meta) |
333359
| parserSelector | Select parser plugins | [metav1.LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#labelselector-v1-meta) |
360+
| multilineParserSelector | Select multiline parser plugins | [metav1.LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#labelselector-v1-meta) |
334361
| namespace | If namespace is defined, then the configmap and secret for fluent-bit is in this namespace. If it is not defined, it is in the namespace of the fluentd-operator | *string |
335362

336363
[Back to TOC](#table-of-contents)
@@ -429,6 +456,28 @@ InputSpec defines the desired state of ClusterInput
429456
| syslog | Syslog defines the Syslog input plugin configuration | *[input.Syslog](plugins/input/syslog.md) |
430457
| tcp | TCP defines the TCP input plugin configuration | *[input.TCP](plugins/input/tcp.md) |
431458

459+
[Back to TOC](#table-of-contents)
460+
# MultilineParser
461+
462+
MultilineParser is the Schema of namespace-level multiline parser API
463+
464+
465+
| Field | Description | Scheme |
466+
| ----- | ----------- | ------ |
467+
| metadata | | [metav1.ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#objectmeta-v1-meta) |
468+
| spec | | MultilineParserSpec |
469+
470+
[Back to TOC](#table-of-contents)
471+
# MultilineParserList
472+
473+
MultilineParserList contains a list of MultilineParser
474+
475+
476+
| Field | Description | Scheme |
477+
| ----- | ----------- | ------ |
478+
| metadata | | [metav1.ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#listmeta-v1-meta) |
479+
| items | | []MultilineParser |
480+
432481
[Back to TOC](#table-of-contents)
433482
# NamespacedFluentBitCfgSpec
434483

@@ -440,7 +489,10 @@ NamespacedFluentBitCfgSpec defines the desired state of FluentBit
440489
| filterSelector | Select filter plugins | [metav1.LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#labelselector-v1-meta) |
441490
| outputSelector | Select output plugins | [metav1.LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#labelselector-v1-meta) |
442491
| parserSelector | Select parser plugins | [metav1.LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#labelselector-v1-meta) |
492+
| service | Service defines the global behaviour of the Fluent Bit engine. | *Service |
443493
| clusterParserSelector | Select cluster level parser config | [metav1.LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#labelselector-v1-meta) |
494+
| multilineParserSelector | Select multiline parser plugins | [metav1.LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#labelselector-v1-meta) |
495+
| clusterMultilineParserSelector | Select cluster level multiline parser config | [metav1.LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#labelselector-v1-meta) |
444496

445497
[Back to TOC](#table-of-contents)
446498
# Output
@@ -572,7 +624,11 @@ ParserSpec defines the desired state of ClusterParser
572624
| logFile | File to log diagnostic output | string |
573625
| logLevel | Diagnostic level (error/warning/info/debug/trace) | string |
574626
| parsersFile | Optional 'parsers' config file (can be multiple) | string |
627+
| parsersFiles | backward compatible | []string |
575628
| storage | Configure a global environment for the storage layer in Service. It is recommended to configure the volume and volumeMount separately for this storage. The hostPath type should be used for that Volume in Fluentbit daemon set. | *Storage |
629+
| emitterName | Per-namespace re-emitter configuration | string |
630+
| emitterMemBufLimit | | string |
631+
| emitterStorageType | | string |
576632

577633
[Back to TOC](#table-of-contents)
578634
# Storage

docs/plugins/fluentbit/filter/lua.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The Lua Filter allows you to modify the incoming records using custom Lua Script
77
| ----- | ----------- | ------ |
88
| script | Path to the Lua script that will be used. | v1.ConfigMapKeySelector |
99
| call | Lua function name that will be triggered to do filtering. It's assumed that the function is declared inside the Script defined above. | string |
10+
| code | Inline LUA code instead of loading from a path via script. | string |
1011
| typeIntKey | If these keys are matched, the fields are converted to integer. If more than one key, delimit by space. Note that starting from Fluent Bit v1.6 integer data types are preserved and not converted to double as in previous versions. | []string |
1112
| protectedMode | If enabled, Lua script will be executed in protected mode. It prevents to crash when invalid Lua script is executed. Default is true. | *bool |
1213
| timeAsTable | By default when the Lua script is invoked, the record timestamp is passed as a Floating number which might lead to loss precision when the data is converted back. If you desire timestamp precision enabling this option will pass the timestamp as a Lua table with keys sec for seconds since epoch and nsec for nanoseconds. | bool |

docs/plugins/fluentbit/filter/multiline.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@
77
| ----- | ----------- | ------ |
88
| parser | Specify one or multiple Multiline Parsing definitions to apply to the content. You can specify multiple multiline parsers to detect different formats by separating them with a comma. | string |
99
| keyContent | Key name that holds the content to process. Note that a Multiline Parser definition can already specify the key_content to use, but this option allows to overwrite that value for the purpose of the filter. | string |
10+
| mode | | string |
11+
| buffer | | bool |
12+
| flushMs | | int |
13+
| emitterName | Name for the emitter input instance which re-emits the completed records at the beginning of the pipeline. | string |
14+
| emitterType | The storage type for the emitter input instance. This option supports the values memory (default) and filesystem. | string |
15+
| emitterMemBufLimit | Set a limit on the amount of memory in MB the emitter can consume if the outputs provide backpressure. The default for this limit is 10M. The pipeline will pause once the buffer exceeds the value of this setting. For example, if the value is set to 10MB then the pipeline will pause if the buffer exceeds 10M. The pipeline will remain paused until the output drains the buffer below the 10M limit. | int |

docs/plugins/fluentbit/filter/rewritetag.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ RewriteTag define a `rewrite_tag` filter, allows to re-emit a record under a new
77
| ----- | ----------- | ------ |
88
| rules | Defines the matching criteria and the format of the Tag for the matching record. The Rule format have four components: KEY REGEX NEW_TAG KEEP. | []string |
99
| emitterName | When the filter emits a record under the new Tag, there is an internal emitter plugin that takes care of the job. Since this emitter expose metrics as any other component of the pipeline, you can use this property to configure an optional name for it. | string |
10+
| emitterMemBufLimit | | string |
11+
| emitterStorageType | | string |
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# MultilineParser
2+
3+
**For full documentation, refer to https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/multiline-parsing**
4+
5+
6+
| Field | Description | Scheme |
7+
| ----- | ----------- | ------ |
8+
| type | Set the multiline mode, for now, we support the type regex. | string |
9+
| parser | Name of a pre-defined parser that must be applied to the incoming content before applying the regex rule. If no parser is defined, it's assumed that's a raw text and not a structured message. | string |
10+
| keyContent | For an incoming structured message, specify the key that contains the data that should be processed by the regular expression and possibly concatenated. | string |
11+
| flushTimeout | Timeout in milliseconds to flush a non-terminated multiline buffer. Default is set to 5 seconds. | int |
12+
| rules | Configure a rule to match a multiline pattern. The rule has a specific format described below. Multiple rules can be defined. | []Rule |
13+
# Rule
14+
15+
16+
17+
18+
| Field | Description | Scheme |
19+
| ----- | ----------- | ------ |
20+
| start | | string |
21+
| regex | | string |
22+
| next | | string |

0 commit comments

Comments
 (0)