Skip to content

Commit e2dea2f

Browse files
authored
Record accessor limitation (#1015)
* administration/configuring-fluent-bit/classic-mode/record-accessor adding record accessos syntax limitation Signed-off-by: RicardoAAD <[email protected]> * administration/configuring-fluent-bit/classic-mode/record-accessor fixed links Signed-off-by: RicardoAAD <[email protected]> * administration:configuring-fluent-bit:classic-mode:record-accessor fixed links Signed-off-by: RicardoAAD <[email protected]> * administration:configuring-fluent-bit:classic-mode:record-accessor fixed links Signed-off-by: RicardoAAD <[email protected]> * administration:configuring-fluent-bit:classic-mode:record-accessor fixed links Signed-off-by: RicardoAAD <[email protected]> * pipeline:filters:ecs-metadata git Changed references to the record_accessor library limitation Signed-off-by: RicardoAAD <[email protected]> * pipeline:filters:ecs-metadata git Changed references to the record_accessor library limitation Signed-off-by: RicardoAAD <[email protected]> * pipeline:filters:ecs-metadata git Changed references to the record_accessor library limitation typos Signed-off-by: RicardoAAD <[email protected]> --------- Signed-off-by: RicardoAAD <[email protected]>
1 parent c638eca commit e2dea2f

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

administration/configuring-fluent-bit/classic-mode/record-accessor.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,23 @@ Fluent Bit v1.x.x
9595
{"date":1599862267.483692,"log":"message 4","labels":{"color":"blue"}}
9696
```
9797

98+
### Limitations of record_accessor templating
99+
100+
The Fluent Bit record_accessor library has a limitation in the characters that can separate template variables- only dots and commas (`.` and `,`) can come after a template variable. This is because the templating library must parse the template and determine the end of a variable.
101+
102+
The following would be invalid templates because the two template variables are not separated by commas or dots:
103+
104+
- `$TaskID-$ECSContainerName`
105+
- `$TaskID/$ECSContainerName`
106+
- `$TaskID_$ECSContainerName`
107+
- `$TaskIDfooo$ECSContainerName`
108+
109+
However, the following are valid:
110+
- `$TaskID.$ECSContainerName`
111+
- `$TaskID.ecs_resource.$ECSContainerName`
112+
- `$TaskID.fooo.$ECSContainerName`
113+
114+
And the following are valid since they only contain one template variable with nothing after it:
115+
- `fooo$TaskID`
116+
- `fooo____$TaskID`
117+
- `fooo/bar$TaskID`

pipeline/filters/ecs-metadata.md

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ The output log would be similar to:
116116
}
117117
```
118118

119-
Notice that the template variables in the value for the `resource` key are separated by dot characters. Please see the section below about limitations in which characters can be used to separate template variables.
119+
Notice that the template variables in the value for the `resource` key are separated by dot characters, only dots and commas
120+
(`.` and `,`) can come after a template variable. For more information, please check the [Record accessor limitation's section](../../administration/configuring-fluent-bit/classic-mode/record-accessor.md#limitations-of-record_accessor-templating).
120121

121122
#### Example 3: Attach cluster metadata to non-container logs
122123

@@ -148,23 +149,3 @@ This examples shows a use case for the `Cluster_Metadata_Only` option- attaching
148149
Format json_lines
149150
```
150151

151-
### Limitations of record_accessor templating
152-
153-
Notice in example 2, that the template values are separated by dot characters. This is important; the Fluent Bit record_accessor library has a limitation in the characters that can separate template variables- only dots and commas (`.` and `,`) can come after a template variable. This is because the templating library must parse the template and determine the end of a variable.
154-
155-
The following would be invalid templates because the two template variables are not separated by commas or dots:
156-
157-
- `$TaskID-$ECSContainerName`
158-
- `$TaskID/$ECSContainerName`
159-
- `$TaskID_$ECSContainerName`
160-
- `$TaskIDfooo$ECSContainerName`
161-
162-
However, the following are valid:
163-
- `$TaskID.$ECSContainerName`
164-
- `$TaskID.ecs_resource.$ECSContainerName`
165-
- `$TaskID.fooo.$ECSContainerName`
166-
167-
And the following are valid since they only contain one template variable with nothing after it:
168-
- `fooo$TaskID`
169-
- `fooo____$TaskID`
170-
- `fooo/bar$TaskID`

0 commit comments

Comments
 (0)