Skip to content

Commit

Permalink
Merge pull request #1575 from kube-logging/sync-code-with-docs-2
Browse files Browse the repository at this point in the history
Sync code with docs 2 - Fluentd filters
  • Loading branch information
pepov authored Dec 2, 2023
2 parents 0ba417c + d8d914b commit afec215
Show file tree
Hide file tree
Showing 36 changed files with 1,335 additions and 1,299 deletions.
2 changes: 1 addition & 1 deletion docs/configuration/plugins/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For more information please click on the plugin name
| **[Concat](filters/concat/)** | filters | Fluentd Filter plugin to concatenate multiline log separated in multiple events. | GA | [2.5.0](https://github.com/fluent-plugins-nursery/fluent-plugin-concat) |
| **[Dedot](filters/dedot/)** | filters | Concatenate multiline log separated in multiple events | GA | [1.0.0](https://github.com/lunardial/fluent-plugin-dedot_filter) |
| **[Exception Detector](filters/detect_exceptions/)** | filters | Exception Detector | GA | [0.0.14](https://github.com/GoogleCloudPlatform/fluent-plugin-detect-exceptions) |
| **[ElasticsearchGenId](filters/elasticsearch_genid/)** | filters | | | []() |
| **[ElasticSearch GenId](filters/elasticsearch_genid/)** | filters | | | [](TODO) |
| **[Enhance K8s Metadata](filters/enhance_k8s/)** | filters | Fluentd output plugin to add extra Kubernetes metadata to the events. | GA | [2.0.0](https://github.com/SumoLogic/sumologic-kubernetes-collection/tree/main/fluent-plugin-enhance-k8s-metadata) |
| **[Geo IP](filters/geoip/)** | filters | Fluentd GeoIP filter | GA | [1.3.2](https://github.com/y-ken/fluent-plugin-geoip) |
| **[Grep](filters/grep/)** | filters | Grep events by the values | GA | [more info](https://docs.fluentd.org/filter/grep) |
Expand Down
55 changes: 27 additions & 28 deletions docs/configuration/plugins/filters/concat.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Default: -

### flush_interval (int, optional) {#concat-flush_interval}

The number of seconds after which the last received event log will be flushed. If specified 0, wait for next line forever.
The number of seconds after which the last received event log is flushed. If set to 0, flushing is disabled (wait for next line forever).

Default: -

Expand Down Expand Up @@ -126,38 +126,37 @@ The key name that is referred to detect stream name on cri log
Default: -


## Example `Concat` filter configurations
```yaml
apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:

name: demo-flow
## Example `Concat` filter configurations

spec:
// {{< highlight yaml >}}
apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:
name: demo-flow
spec:
filters:
- concat:
partial_key: "partial_message"
separator: ""
n_lines: 10
selectors: {}
localOutputRefs:
- demo-output
// {{< /highlight >}}

filters:
- concat:
partial_key: "partial_message"
separator: ""
n_lines: 10
selectors: {}
localOutputRefs:
- demo-output

```
#### Fluentd config result:

#### Fluentd Config Result
```yaml
<filter **>
{{< highlight xml >}}
<filter **>
@type concat
@id test_concat
key message
n_lines 10
partial_key partial_message
</filter>
{{< /highlight >}}

@type concat
@id test_concat
key message
n_lines 10
partial_key partial_message

</filter>
```

---
52 changes: 25 additions & 27 deletions docs/configuration/plugins/filters/dedot.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ generated_file: true

### de_dot_nested (bool, optional) {#dedotfilterconfig-de_dot_nested}

Will cause the plugin to recurse through nested structures (hashes and arrays), and remove dots in those key-names too.
Will cause the plugin to recourse through nested structures (hashes and arrays), and remove dots in those key-names too.

Default: false

Expand All @@ -24,36 +24,34 @@ Separator
Default: _


## Example `Dedot` filter configurations
```yaml
apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:

name: demo-flow
## Example `Dedot` filter configurations
{{< highlight yaml >}}
apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:
name: demo-flow
spec:
filters:
- dedot:
de_dot_separator: "-"
de_dot_nested: true
selectors: {}
localOutputRefs:
- demo-output
{{</ highlight >}}

spec:

filters:
- dedot:
de_dot_separator: "-"
de_dot_nested: true
selectors: {}
localOutputRefs:
- demo-output
#### Fluentd config result:

```
{{< highlight xml >}}
<filter **>
@type dedot
@id test_dedot
de_dot_nested true
de_dot_separator -
</filter>
{{</ highlight >}}

#### Fluentd Config Result
```yaml
<filter **>

@type dedot
@id test_dedot
de_dot_nested true
de_dot_separator -

</filter>
```

---
72 changes: 35 additions & 37 deletions docs/configuration/plugins/filters/detect_exceptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Default: nil

Programming languages for which to detect exceptions.

Default: []
Default: `[]`

### max_lines (int, optional) {#detectexceptions-max_lines}

Expand Down Expand Up @@ -75,42 +75,40 @@ Default: false

Tag used in match directive.

Default: kubernetes.**
Default: `kubernetes.**`



## Example `Exception Detector` filter configurations
{{< highlight yaml >}}
apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:
name: demo-flow
spec:
filters:
- detectExceptions:
multiline_flush_interval: 0.1
languages:
- java
- python
selectors: {}
localOutputRefs:
- demo-output
{{</ highlight >}}


#### Fluentd config result:

{{< highlight xml >}}
<match kubernetes.**>
@type detect_exceptions
@id test_detect_exceptions
languages ["java","python"]
multiline_flush_interval 0.1
remove_tag_prefix kubernetes
</match>
{{</ highlight >}}


## Example `Exception Detector` filter configurations
```yaml
apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:

name: demo-flow

spec:

filters:
- detectExceptions:
multiline_flush_interval: 0.1
languages:
- java
- python
selectors: {}
localOutputRefs:
- demo-output

```

#### Fluentd Config Result
```yaml
<match kubernetes.**>

@type detect_exceptions
@id test_detect_exceptions
languages ["java","python"]
multiline_flush_interval 0.1
remove_tag_prefix kubernetes

</match>
```

---
34 changes: 34 additions & 0 deletions docs/configuration/plugins/filters/elasticsearch_genid.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
---
title: ElasticSearch GenId
weight: 200
generated_file: true
---

# ElasticSearch GenId
## Overview

TODO: FILL
// ## Example `Elasticsearch Genid` filter configurations
{{< highlight yaml >}}
apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:
name: demo-flow
spec:
filters:
- elasticsearch_genid:
hash_id_key: gen_id
selectors: {}
localOutputRefs:
- demo-output

#### Fluentd Config Result
<filter **>
@type elasticsearch_genid
@id test_elasticsearch_genid
hash_id_key gen_id
</filter>
{{</ highlight >}}


## Configuration
## ElasticsearchGenId

### hash_id_key (string, optional) {#elasticsearchgenid-hash_id_key}
Expand Down
43 changes: 21 additions & 22 deletions docs/configuration/plugins/filters/enhance_k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ generated_file: true

parameters for read/write record

Default: ['$.namespace']
Default: `['$.namespace']`

### in_pod_path ([]string, optional) {#enhancek8s-in_pod_path}

Default: ['$.pod','$.pod_name']
Default: `['$.pod','$.pod_name']`

### data_type (string, optional) {#enhancek8s-data_type}

Expand Down Expand Up @@ -79,11 +79,11 @@ Default: ['v1']

Kubernetes resources api groups

Default: ["apps/v1", "extensions/v1beta1"]
Default: `["apps/v1", "extensions/v1beta1"]`

### ssl_partial_chain (*bool, optional) {#enhancek8s-ssl_partial_chain}

if `ca_file` is for an intermediate CA, or otherwise we do not have the root CA and want to trust the intermediate CA certs we do have, set this to `true` - this corresponds to the openssl s_client -partial_chain flag and X509_V_FLAG_PARTIAL_CHAIN
If `ca_file` is for an intermediate CA, or otherwise we do not have the root CA and want to trust the intermediate CA certs we do have, set this to `true` - this corresponds to the openssl s_client -partial_chain flag and X509_V_FLAG_PARTIAL_CHAIN

Default: false

Expand Down Expand Up @@ -112,29 +112,28 @@ Cache refresh variation
Default: 60*15


## Example `EnhanceK8s` filter configurations
```yaml
apiVersion: logging.banzaicloud.io/v1beta1
kind: Logging
metadata:

name: demo-flow
## Example `EnhanceK8s` filter configurations

spec:
{{< highlight yaml >}}
apiVersion: logging.banzaicloud.io/v1beta1
kind: Logging
metadata:
name: demo-flow
spec:
globalFilters:
- enhanceK8s: {}
{{</ highlight >}}

globalFilters:
- enhanceK8s: {}

```
#### Fluentd config result:

#### Fluentd Config Result
```yaml
<filter **>
{{< highlight xml >}}
<filter **>
@type enhance_k8s_metadata
@id test_enhanceK8s
</filter>
{{</ highlight >}}

@type enhance_k8s_metadata
@id test_enhanceK8s

</filter>
```

---
Loading

0 comments on commit afec215

Please sign in to comment.