Skip to content

Commit fa37a8d

Browse files
Apply suggestions from code review
Co-authored-by: Alexa Kreizinger <[email protected]> Signed-off-by: Lynette Miles <[email protected]>
1 parent ba4670f commit fa37a8d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pipeline/filters/kubernetes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ For Fluent Bit v1.2 or greater, don't use decoders (`Decode_Field_As`) if you ar
8181
To perform processing of the `log` key, you must enable the `Merge_Log` configuration property in this filter, then the following processing order will be done:
8282

8383
- If a pod suggests a parser, the filter will use that parser to process the content of `log`.
84-
- If the `Merge_Parser` options was set and the pod didn't suggest a parser, process the `log` content using the suggested parser in the configuration.
84+
- If the `Merge_Parser` option was set and the pod didn't suggest a parser, process the `log` content using the suggested parser in the configuration.
8585
- If no pod was suggested and no `Merge_Parser` is set, try to handle the content as JSON.
8686

8787
If `log` value processing fails, the value is untouched. The order of processing isn't chained, meaning it's exclusive and the filter will try only one of the options, not all of them.
@@ -169,7 +169,7 @@ For example:
169169
"kubernetes"=>{"pod_name"=>"fluentbit-gke-2p6b5", "namespace_name"=>"kube-system", "pod_id"=>"c759a5f5-xxxx-xxxx-9117-8a1dc0b1f907", "labels"=>{"component"=>"xxxx", "controller-revision-hash"=>"77665fff9", "k8s-app"=>"fluentbit-xxxx"}, "ownerReferences"=>[{"apiVersion"=>"apps/v1", "kind"=>"DaemonSet", "name"=>"fluentbit-gke", "uid"=>"1a12c3e2-d6c4-4a8a-b877-dd3c857d1aea", "controller"=>true, "blockOwnerDeletion"=>true}], "host"=>"xxx-2a9c049c-qgw3", "pod_ip"=>"10.128.0.111", "container_name"=>"fluentbit", "docker_id"=>"2accxxx", "container_hash"=>"xxxx", "container_image"=>"sha256:5163dxxxxea2"}
170170
```
171171

172-
## Workflow of tail and Kubernetes filter
172+
## Workflow of Tail and Kubernetes filter
173173

174174
Kubernetes Filter depends on either [Tail](../inputs/tail.md) or [Systemd](../inputs/systemd.md) input plugins to process and enrich records with Kubernetes metadata. Consider the following configuration example:
175175

@@ -230,7 +230,7 @@ The transformation doesn't modify the original tag, it creates a new representat
230230
The new value is used by the filter to lookup the pod name and namespace, for that purpose it uses an internal regular expression:
231231

232232
```text
233-
(?<pod_name>[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64}).log$
233+
(?<pod_name>[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64})\.log$
234234
```
235235

236236
For more details, review the source code of that definition [here](https://github.com/fluent/fluent-bit/blob/master/plugins/filter_kubernetes/kube_regex.h#L26>).
@@ -245,7 +245,7 @@ Under some uncommon conditions, a user might want to alter that hard-coded regul
245245

246246
#### Custom tags For enhanced filtering
247247

248-
One such use case involves splitting logs by namespace, pods, containers or container id. The tag is restructured within the tail input using match groups. Restructuring can simplify the filtering by those match groups later in the pipeline. Since the tag no longer follows the original filename, a custom `Regex_Parser` that matches the new tag structure is required:
248+
One such use case involves splitting logs by namespace, pods, containers or container ID. The tag is restructured within the tail input using match groups. Restructuring can simplify the filtering by those match groups later in the pipeline. Since the tag no longer follows the original filename, a custom `Regex_Parser` that matches the new tag structure is required:
249249

250250
```python
251251
[PARSER]
@@ -411,7 +411,7 @@ To know if Fluent Bit is using the kubelet, you can review Fluent Bit logs. Ther
411411
[ info] [filter:kubernetes:kubernetes.0] testing connectivity with Kubelet...
412412
```
413413

414-
If you are in debug mode, you could see more:
414+
If you are in debug mode, you can see more:
415415

416416
```text
417417
[debug] [filter:kubernetes:kubernetes.0] Send out request to Kubelet for pods information.

0 commit comments

Comments
 (0)