Skip to content

Commit 8f065d6

Browse files
out_azure_logs_ingestion: add support for Managed Identities
This change updates the documentation to document support for Managed Identities authentication. It tries to align with the documentation style and content for the similar feature for the out_azure_kusto plugin. Signed-off-by: Stefano Boriero <[email protected]>
1 parent 39c3205 commit 8f065d6

File tree

1 file changed

+191
-1
lines changed

1 file changed

+191
-1
lines changed

pipeline/outputs/azure_logs_ingestion.md

Lines changed: 191 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,37 @@ To get more details about how to set up these components, refer to the following
2121
- [Azure Logs Ingestion API](https://docs.microsoft.com/en-us/azure/log-analytics/)
2222
- [Send data to Azure Monitor Logs with Logs ingestion API (setup DCE, DCR and Log Analytics)](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/tutorial-logs-ingestion-portal)
2323

24+
## Authentication Methods
25+
26+
Fluent-Bit can use various authentication methods to send records to Azure Log Analytics:
27+
28+
### Service Principal Authentication (Default)
29+
30+
For service principal authentication, you'll need to create an Azure AD application:
31+
32+
- [Register an Application](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#register-an-application)
33+
- [Add a client secret](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#add-a-client-secret)
34+
- [Authorize the app in your database](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/management/access-control/principals-and-identity-providers#azure-ad-tenants)
35+
36+
Configure Fluent Bit with your application's `tenant_id`, `client_id`, and `client_secret`.
37+
38+
### Managed Identity Authentication
39+
40+
When running on Azure services that support Managed Identities (such as Azure VMs, AKS, or App Service):
41+
42+
1. [Assign the managed identity appropriate permissions to your Kusto database](https://learn.microsoft.com/en-us/azure/data-explorer/configure-managed-identities-cluster)
43+
2. Configure Fluent Bit with `auth_type` set to `managed_identity`
44+
3. For system-assigned identity, set `client_id` to `system`
45+
4. For user-assigned identity, set `client_id` to the managed identity's client ID (GUID)
46+
2447
## Configuration parameters
2548

2649
| Key | Description | Default |
2750
| :------------ | :------------------------- | :------ |
2851
| `tenant_id` | The tenant ID of the Azure Active Directory (AAD) application. | _none_ |
29-
| `client_id` | The client ID of the AAD application. | _none_ |
52+
| `client_id` | _Required for service_principal and managed_identity auth_ - The client ID of the AAD registered application. When using managed identity authentication, set this to 'system' for system-assigned identity or provide the managed identity's client ID. | _none_ |
3053
| `client_secret`| The client secret of the AAD application ([App Secret](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret)). | _none_ |
54+
| auth_type | Authentication type to use. Supported values: `service_principal` (default) or `managed_identity`.
3155
| `dce_url` | Data Collection Endpoint(DCE) URL. | _none_ |
3256
| `dcr_id` | Data Collection Rule (DCR) [immutable ID](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/tutorial-logs-ingestion-portal#collect-information-from-the-dcr). | _none_ |
3357
| `table_name` | The name of the custom log table (include the `_CL` suffix as well if applicable) | _none_ |
@@ -51,6 +75,8 @@ Follow [this guideline](https://learn.microsoft.com/en-us/azure/azure-monitor/lo
5175

5276
Use this configuration file to get started:
5377

78+
#### Service Principal Authentication (Default)
79+
5480
{% tabs %}
5581
{% tab title="fluent-bit.yaml" %}
5682

@@ -133,4 +159,168 @@ pipeline:
133159
{% endtab %}
134160
{% endtabs %}
135161

162+
#### User assigned Managed Identity Authentication
163+
164+
{% tabs %}
165+
{% tab title="fluent-bit.yaml" %}
166+
167+
```yaml
168+
pipeline:
169+
inputs:
170+
- name: tail
171+
path: /path/to/your/sample.log
172+
tag: sample
173+
key: RawData
174+
175+
# Or use other plugins
176+
#- name: cpu
177+
# tag: sample
178+
179+
filters:
180+
- name: modify
181+
match: sample
182+
# Add a json key named "Application":"fb_log"
183+
add: Application fb_log
184+
185+
outputs:
186+
# Enable this section to see your json-log format
187+
#- name: stdout
188+
# match: '*'
189+
190+
- name: azure_logs_ingestion
191+
match: sample
192+
client_id: XXXXXXXX-xxxx-yyyy-zzzz-xxxxyyyyzzzzxyzz
193+
auth_type: managed_identity
194+
dce_url: https://log-analytics-dce-XXXX.region-code.ingest.monitor.azure.com
195+
dcr_id: dcr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
196+
table_name: ladcr_CL
197+
time_generated: true
198+
time_key: Time
199+
compress: true
200+
```
201+
202+
{% endtab %}
203+
{% tab title="fluent-bit.conf" %}
204+
205+
```text
206+
[INPUT]
207+
Name tail
208+
Path /path/to/your/sample.log
209+
Tag sample
210+
Key RawData
211+
212+
# Or use other plugins
213+
#[INPUT]
214+
# Name cpu
215+
# Tag sample
216+
217+
[FILTER]
218+
Name modify
219+
Match sample
220+
# Add a json key named "Application":"fb_log"
221+
Add Application fb_log
222+
223+
# Enable this section to see your json-log format
224+
#[OUTPUT]
225+
# Name stdout
226+
# Match *
227+
228+
[OUTPUT]
229+
Name azure_logs_ingestion
230+
Match sample
231+
client_id XXXXXXXX-xxxx-yyyy-zzzz-xxxxyyyyzzzzxyzz
232+
auth_type managed_identity
233+
dce_url https://log-analytics-dce-XXXX.region-code.ingest.monitor.azure.com
234+
dcr_id dcr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
235+
table_name ladcr_CL
236+
time_generated true
237+
time_key Time
238+
Compress true
239+
```
240+
241+
{% endtab %}
242+
{% endtabs %}
243+
244+
#### System assigned Managed Identity Authentication
245+
246+
{% tabs %}
247+
{% tab title="fluent-bit.yaml" %}
248+
249+
```yaml
250+
pipeline:
251+
inputs:
252+
- name: tail
253+
path: /path/to/your/sample.log
254+
tag: sample
255+
key: RawData
256+
257+
# Or use other plugins
258+
#- name: cpu
259+
# tag: sample
260+
261+
filters:
262+
- name: modify
263+
match: sample
264+
# Add a json key named "Application":"fb_log"
265+
add: Application fb_log
266+
267+
outputs:
268+
# Enable this section to see your json-log format
269+
#- name: stdout
270+
# match: '*'
271+
272+
- name: azure_logs_ingestion
273+
match: sample
274+
client_id: system
275+
auth_type: managed_identity
276+
dce_url: https://log-analytics-dce-XXXX.region-code.ingest.monitor.azure.com
277+
dcr_id: dcr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
278+
table_name: ladcr_CL
279+
time_generated: true
280+
time_key: Time
281+
compress: true
282+
```
283+
284+
{% endtab %}
285+
{% tab title="fluent-bit.conf" %}
286+
287+
```text
288+
[INPUT]
289+
Name tail
290+
Path /path/to/your/sample.log
291+
Tag sample
292+
Key RawData
293+
294+
# Or use other plugins
295+
#[INPUT]
296+
# Name cpu
297+
# Tag sample
298+
299+
[FILTER]
300+
Name modify
301+
Match sample
302+
# Add a json key named "Application":"fb_log"
303+
Add Application fb_log
304+
305+
# Enable this section to see your json-log format
306+
#[OUTPUT]
307+
# Name stdout
308+
# Match *
309+
310+
[OUTPUT]
311+
Name azure_logs_ingestion
312+
Match sample
313+
client_id system
314+
auth_type managed_identity
315+
dce_url https://log-analytics-dce-XXXX.region-code.ingest.monitor.azure.com
316+
dcr_id dcr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
317+
table_name ladcr_CL
318+
time_generated true
319+
time_key Time
320+
Compress true
321+
```
322+
323+
{% endtab %}
324+
{% endtabs %}
325+
136326
Set up your DCR transformation based on the JSON output from the Fluent Bit pipeline (input, parser, filter, output).

0 commit comments

Comments
 (0)