Skip to content

Commit d758af1

Browse files
pipeline: processors: sql: general cleanup
Signed-off-by: Alexa Kreizinger <[email protected]>
1 parent 5610226 commit d758af1

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

pipeline/processors/sql.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
1-
# Structured Query Language (SQL)
1+
# SQL
22

3-
The **sql** processor provides a simple interface to select content from Logs by also supporting conditional expressions.
3+
The _SQL_ processor lets you use conditional expressions to select content from logs. This processor doesn't depend on a database or table. Instead, your queries run on the stream.
44

5-
Our SQL processor does not depend on a database or indexing; it runs everything on the fly (this is good). We don't have the concept of tables but you run the query on the STREAM.
6-
7-
Note that this processor differs from the "stream processor interface" that runs after the filters; this one can only be used in the processor's section of the input plugins when using YAML configuration mode.
5+
This processor differs from the stream processor interface that runs after filters.
86

97
{% hint style="info" %}
108

11-
**Note:** Both processors and this specific component can be enabled only by using
12-
the YAML configuration format. Classic mode configuration format doesn't support processors.
9+
Only [YAML configuration files](../administration/configuring-fluent-bit/yaml/README.md) support processors.
1310

1411
{% endhint %}
1512

16-
## Configuration Parameters
13+
## Configuration parameters
1714

18-
| Key | Description |
19-
| :---------- | :--- |
20-
| query | Define the SQL statement to run on top of the Logs stream; it must end with `;` . |
15+
| Key | Description |
16+
| --- | ----------- |
17+
| `query` | The SQL statement to query your logs stream. This statement must end with `;`. |
2118

22-
### Simple selection example
19+
## Basic selection example
2320

24-
The following example generates a sample message with two keys called `key` and `http.url`. By using a simple SQL statement we will select only the key `http.url`.
21+
The following example generates a sample message with two keys: `key` and `http.url`, then uses a SQL statement to select only the key `http.url`.
2522

2623
{% tabs %}
2724
{% tab title="fluent-bit.yaml" %}
@@ -31,12 +28,12 @@ pipeline:
3128
inputs:
3229
- name: dummy
3330
dummy: '{"key1": "123.4", "http.url": "https://fluentbit.io/search?q=docs"}'
34-
31+
3532
processors:
3633
logs:
3734
- name: sql
3835
query: "SELECT http.url FROM STREAM;"
39-
36+
4037
outputs:
4138
- name : stdout
4239
match: '*'
@@ -46,9 +43,9 @@ pipeline:
4643
{% endtab %}
4744
{% endtabs %}
4845
49-
### Extract and select example
46+
## Extract and select example
5047
51-
Similar to the example above, now we will extract the parts of `http.url` and only select the domain from the value, for that we will use together content-modifier and sql processors together:
48+
The following example is similar to the previous example, but additionally extracts part of `http.url` to select the domain from the value. To accomplish this, use the `content-modifier` and `sql` processors in tandem:
5249

5350
{% tabs %}
5451
{% tab title="fluent-bit.yaml" %}
@@ -78,11 +75,11 @@ pipeline:
7875
{% endtab %}
7976
{% endtabs %}
8077

81-
the expected output of this pipeline will be something like this:
78+
The resulting output resembles the following:
8279

8380
```json
8481
{
8582
"date": 1711059261.630668,
8683
"http_domain": "fluentbit.io"
8784
}
88-
```
85+
```

vale-styles/FluentBit/Headings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ exceptions:
6565
- ServiceMonitor
6666
- SignalFx
6767
- Slack
68+
- SQL
6869
- SSL
6970
- StatsD
7071
- Studio

0 commit comments

Comments
 (0)