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/processors/sql.md
+16-19Lines changed: 16 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,24 @@
1
-
# Structured Query Language (SQL)
1
+
# SQL
2
2
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.
4
4
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.
8
6
9
7
{% hint style="info" %}
10
8
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.
13
10
14
11
{% endhint %}
15
12
16
-
## Configuration Parameters
13
+
## Configuration parameters
17
14
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 `;`. |
21
18
22
-
### Simple selection example
19
+
##Basic selection example
23
20
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`.
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:
52
49
53
50
{% tabs %}
54
51
{% tab title="fluent-bit.yaml" %}
@@ -78,11 +75,11 @@ pipeline:
78
75
{% endtab %}
79
76
{% endtabs %}
80
77
81
-
the expected output of this pipeline will be something like this:
0 commit comments