microsoft-sentinel-log-analytics-logstash-output-plugin 1.1.4 → 2.2.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1b93ef7e00ec54fd6aea1712b10a16947a3bf4a226a7992897ae5e6fb2f7708
4
- data.tar.gz: 712e6f247d574d5b48bb87693af44098401246c192ab886d0b3960c318861491
3
+ metadata.gz: ea487790648bd37da80785720d41eba04d6e25d26b51acd4dedaae12d4df788e
4
+ data.tar.gz: 2c5e07886e64407c588ebae4d080796ae83e4a5c24a6dd287cc91a8858e1bea4
5
5
  SHA512:
6
- metadata.gz: 66758c4c92a88a28a81b19161dc1e55d727675ad5f788d6abfce1a495603de7a601a0f4fd9ee35c8ad746a3f782b019cf7343c3c9c472c3f2ddf03a8a1b348f1
7
- data.tar.gz: 234aee955f0a3ce3a1dbb5c84f620d87ef350053491a716e57feb15282fddf2cce69003add06ef73bf017fa682d9c5e165cfe1b7ad3bc158e1f6a9bf21ec55a8
6
+ metadata.gz: 0a76b54722684ef96a897363bfe0b2104dc14c99ef7e196585a8e6ae2e03606e330c16ece586a262148a41cfee41797304ec8ecde13cdc3839005645b808d79c
7
+ data.tar.gz: d18a87da9ac8d7b5f19c3be49744d0ed7051b343fda7a8dc9dbb52c4f88c3c83dcb81310cbae590c910f0a2adb539c5dfe8ed4118303f4f24eb5969c7fe248a2
data/CHANGELOG.md CHANGED
@@ -1,16 +1,18 @@
1
- ## 1.1.4
2
- - Limit `excon` library version to lower than 1.0.0 to make sure port is always used when using a proxy.
3
-
4
- ## 1.1.3
5
- - Replaces the `rest-client` library used for connecting to Azure with the `excon` library.
6
-
7
- ## 1.1.1
8
- - Adds support for Azure US Government cloud and Microsoft Azure operated by 21Vianet in China.
9
-
10
- ## 1.1.0
11
- - Allows setting different proxy values for API connections.
12
- - Upgrades version for logs ingestion API to 2023-01-01.
13
- - Renames the plugin to microsoft-sentinel-log-analytics-logstash-output-plugin.
14
-
15
- ## 1.0.0
16
- - The initial release for the Logstash output plugin for Microsoft Sentinel. This plugin uses Data Collection Rules (DCRs) with Azure Monitor's Logs Ingestion API.
1
+ ## 2.2.1
2
+ - Adds info-level logging line when batches are successfully sent.
3
+
4
+ ## 2.2.0
5
+ - Adds ability to use either new or old configuration values.
6
+
7
+ ## 2.1.2
8
+ - Documentation updates
9
+
10
+ ## 2.1.1
11
+ - Improved efficiency.
12
+
13
+ ## 2.1.0
14
+ - Fixed event normalization.
15
+
16
+ ## 2.0.0
17
+ - Refactored the plugin from Ruby to Java.
18
+ - Added ManagedIdentity authentication.
data/Gemfile CHANGED
@@ -1,2 +1,12 @@
1
- source 'https://rubygems.org'
2
- gemspec
1
+ # AUTOGENERATED BY THE GRADLE SCRIPT. EDITS WILL BE OVERWRITTEN.
2
+ source 'https://rubygems.org'
3
+
4
+ gemspec
5
+
6
+ logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
7
+ use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
8
+
9
+ if Dir.exist?(logstash_path) && use_logstash_source
10
+ gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
11
+ gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
12
+ end
data/README.md CHANGED
@@ -1,258 +1,251 @@
1
- # Microsoft Sentinel output plugin for Logstash
2
-
3
- Microsoft Sentinel provides a new output plugin for Logstash. Use this output plugin to send any log via Logstash to the Microsoft Sentinel/Log Analytics workspace. This is done with the Log Analytics DCR-based API.
4
- You may send logs to custom or standard tables.
5
-
6
- Plugin version: v1.1.3
7
- Released on: 2024-10-10
8
-
9
- This plugin is currently in development and is free to use. We welcome contributions from the open source community on this project, and we request and appreciate feedback from users.
10
-
11
- ## Installation Instructions
12
- 1) Install the plugin
13
- 2) Create a sample file
14
- 3) Create the required DCR-related resources
15
- 4) Configure Logstash configuration file
16
- 5) Basic logs transmission
17
-
18
-
19
- ## 1. Install the plugin
20
-
21
- Microsoft Sentinel provides Logstash output plugin to Log analytics workspace using DCR based logs API.
22
-
23
- The plugin is published on [RubyGems](https://rubygems.org/gems/microsoft-sentinel-log-analytics-logstash-output-plugin). To install to an existing logstash installation, run `logstash-plugin install microsoft-sentinel-log-analytics-logstash-output-plugin`.
24
-
25
- If you do not have a direct internet connection, you can install the plugin to another logstash installation, and then export and import a plugin bundle to the offline host. For more information, see [Logstash Offline Plugin Management instruction](<https://www.elastic.co/guide/en/logstash/current/offline-plugins.html>).
26
-
27
- Microsoft Sentinel's Logstash output plugin supports the following versions
28
- - 7.0 - 7.17.13
29
- - 8.0 - 8.9
30
- - 8.11 - 8.15
31
-
32
- Please note that when using Logstash 8, it is recommended to disable ECS in the pipeline. For more information refer to [Logstash documentation.](<https://www.elastic.co/guide/en/logstash/8.4/ecs-ls.html>)
33
-
34
-
35
- ## 2. Create a sample file
36
- To create a sample file, follow the following steps:
37
- 1) Copy the output plugin configuration below to your Logstash configuration file:
38
- ```
39
- output {
40
- microsoft-sentinel-log-analytics-logstash-output-plugin {
41
- create_sample_file => true
42
- sample_file_path => "<enter the path to the file in which the sample data will be written>" #for example: "c:\\temp" (for windows) or "/var/log" for Linux.
43
- }
44
- }
45
- ```
46
- Note: make sure that the path exists before creating the sample file.
47
- 2) Start Logstash. The plugin will collect up to 10 records to a sample.
48
- 3) The file named "sampleFile<epoch seconds>.json" in the configured path will be created once there are 10 events to sample or when the Logstash process exited gracefully. (for example: "c:\temp\sampleFile1648453501.json").
49
-
50
-
51
- ### Configurations:
52
- The following parameters are optional and should be used to create a sample file.
53
- - **create_sample_file** - Boolean, False by default. When enabled, up to 10 events will be written to a sample json file.
54
- - **sample_file_path** - Number, Empty by default. Required when create_sample_file is enabled. Should include a valid path in which to place the sample file generated.
55
-
56
- ### Complete example
57
- 1. set the pipeline.conf with the following configuration:
58
- ```
59
- input {
60
- generator {
61
- lines => [ "This is a test log message"]
62
- count => 10
63
- }
64
- }
65
-
66
- output {
67
- microsoft-sentinel-log-analytics-logstash-output-plugin {
68
- create_sample_file => true
69
- sample_file_path => "<enter the path to the file in which the sample data will be written>" #for example: "c:\\temp" (for windows) or "/var/log" for Linux.
70
- }
71
- }
72
- ```
73
-
74
- 2. the following sample file will be generated:
75
- ```
76
- [
77
- {
78
- "host": "logstashMachine",
79
- "sequence": 0,
80
- "message": "This is a test log message",
81
- "ls_timestamp": "2022-10-29T13:19:28.116Z",
82
- "ls_version": "1"
83
- },
84
- ...
85
- ]
86
- ```
87
-
88
- ## 3. Create the required DCR-related resources
89
- To configure Microsoft Sentinel Logstash plugin you first need to create the DCR-related resources. To create these resources, follow one of the following tutorials:
90
- 1) To ingest the data to a custom table use [Tutorial - Send custom logs to Azure Monitor Logs (preview) - Azure Monitor | Microsoft Docs](<https://docs.microsoft.com/azure/azure-monitor/logs/tutorial-custom-logs>) tutorial. Note that as part of creating the table and the DCR you will need to provide the sample file that you've created in the previous section.
91
- 2) To ingest the data to a standard table like Syslog or CommonSecurityLog use [Tutorial - Send custom logs to Azure Monitor Logs using resource manager templates - Azure Monitor | Microsoft Docs](<https://docs.microsoft.com/azure/azure-monitor/logs/tutorial-custom-logs-api>).
92
-
93
-
94
- ## 4. Configure Logstash configuration file
95
-
96
- Use the tutorial from the previous section to retrieve the following attributes:
97
- - **client_app_Id** - String, The 'Application (client) ID' value created in step #3 of the "Configure Application" section of the tutorial you used in the previous step.
98
- - **client_app_secret** -String, The value of the client secret created in step #5 of the "Configure Application" section of the tutorial you used in the previous step.
99
- - **tenant_id** - String, Your subscription's tenant id. You can find in the following path: Home -> Azure Active Directory -> Overview Under 'Basic Information'.
100
- - **data_collection_endpoint** - String, - The value of the logsIngestion URI (see step #3 of the "Create data collection endpoint" section in Tutorial [Tutorial - Send custom logs to Azure Monitor Logs using resource manager templates - Azure Monitor | Microsoft Docs](<https://docs.microsoft.com/azure/azure-monitor/logs/tutorial-custom-logs-api#create-data-collection-endpoint>).
101
- - **dcr_immutable_id** - String, The value of the DCR immutableId (see the "Collect information from DCR" section in [Tutorial - Send custom logs to Azure Monitor Logs (preview) - Azure Monitor | Microsoft Docs](<https://docs.microsoft.com/azure/azure-monitor/logs/tutorial-custom-logs#collect-information-from-dcr>).
102
- - **dcr_stream_name** - String, The name of the data stream (Go to the json view of the DCR as explained in the "Collect information from DCR" section in [Tutorial - Send custom logs to Azure Monitor Logs (preview) - Azure Monitor | Microsoft Docs](<https://docs.microsoft.com/azure/azure-monitor/logs/tutorial-custom-logs#collect-information-from-dcr>) and copy the value of the "dataFlows -> streams" property (see circled in red in the below example).
103
-
104
- After retrieving the required values replace the output section of the Logstash configuration file created in the previous steps with the example below. Then, replace the strings in the brackets below with the corresponding values. Make sure you change the "create_sample_file" attribute to false.
105
-
106
- Here is an example for the output plugin configuration section:
107
- ```
108
- output {
109
- microsoft-sentinel-log-analytics-logstash-output-plugin {
110
- client_app_Id => "<enter your client_app_id value here>"
111
- client_app_secret => "<enter your client_app_secret value here>"
112
- tenant_id => "<enter your tenant id here>"
113
- data_collection_endpoint => "<enter your DCE logsIngestion URI here>"
114
- dcr_immutable_id => "<enter your DCR immutableId here>"
115
- dcr_stream_name => "<enter your stream name here>"
116
- create_sample_file=> false
117
- sample_file_path => "c:\\temp"
118
- }
119
- }
120
-
121
- ```
122
- ### Optional configuration
123
- - **key_names** – Array of strings, if you wish to send a subset of the columns to Log Analytics.
124
- - **plugin_flush_interval** Number, 5 by default. Defines the maximal time difference (in seconds) between sending two messages to Log Analytics.
125
- - **retransmission_time** - Number, 10 by default. This will set the amount of time in seconds given for retransmitting messages once sending has failed.
126
- - **compress_data** - Boolean, false by default. When this field is true, the event data is compressed before using the API. Recommended for high throughput pipelines
127
- - **proxy** - String, Empty by default. Specify which proxy URL to use for API calls for all of the communications with Azure.
128
- - **proxy_aad** - String, Empty by default. Specify which proxy URL to use for API calls for the Azure Active Directory service. Overrides the proxy setting.
129
- - **proxy_endpoint** - String, Empty by default. Specify which proxy URL to use when sending log data to the endpoint. Overrides the proxy setting.
130
- - **azure_cloud** - String, Empty by default. Used to specify the name of the Azure cloud that is being used, AzureCloud is set as default. Available values are: AzureCloud, AzureChinaCloud and AzureUSGovernment.
131
-
132
- #### Note: When setting an empty string as a value for a proxy setting, it will unset any system wide proxy setting.
133
-
134
- Security notice: We recommend not to implicitly state client_app_Id, client_app_secret, tenant_id, data_collection_endpoint, and dcr_immutable_id in your Logstash configuration for security reasons.
135
- It is best to store this sensitive information in a Logstash KeyStore as described here- ['Secrets Keystore'](<https://www.elastic.co/guide/en/logstash/current/keystore.html>)
136
-
137
-
138
- ## 5. Basic logs transmission
139
-
140
- Here is an example configuration that parses Syslog incoming data into a custom stream named "Custom-MyTableRawData".
141
-
142
- ### Example Configuration
143
-
144
- - Using filebeat input pipe
145
-
146
- ```
147
- input {
148
- beats {
149
- port => "5044"
150
- }
151
- }
152
- filter {
153
- }
154
- output {
155
- microsoft-sentinel-log-analytics-logstash-output-plugin {
156
- client_app_Id => "619c1731-15ca-4403-9c61-xxxxxxxxxxxx"
157
- client_app_secret => "xxxxxxxxxxxxxxxx"
158
- tenant_id => "72f988bf-86f1-41af-91ab-xxxxxxxxxxxx"
159
- data_collection_endpoint => "https://my-customlogsv2-test-jz2a.eastus2-1.ingest.monitor.azure.com"
160
- dcr_immutable_id => "dcr-xxxxxxxxxxxxxxxxac23b8978251433a"
161
- dcr_stream_name => "Custom-MyTableRawData"
162
- proxy_aad => "http://proxy.example.com"
163
- }
164
- }
165
-
166
- ```
167
- - Or using the tcp input pipe
168
-
169
- ```
170
- input {
171
- tcp {
172
- port => "514"
173
- type => syslog #optional, will effect log type in table
174
- }
175
- }
176
- filter {
177
- }
178
- output {
179
- microsoft-sentinel-log-analytics-logstash-output-plugin {
180
- client_app_Id => "619c1731-15ca-4403-9c61-xxxxxxxxxxxx"
181
- client_app_secret => "xxxxxxxxxxxxxxxx"
182
- tenant_id => "72f988bf-86f1-41af-91ab-xxxxxxxxxxxx"
183
- data_collection_endpoint => "https://my-customlogsv2-test-jz2a.eastus2-1.ingest.monitor.azure.com"
184
- dcr_immutable_id => "dcr-xxxxxxxxxxxxxxxxac23b8978251433a"
185
- dcr_stream_name => "Custom-MyTableRawData"
186
- }
187
- }
188
- ```
189
-
190
- <u>Advanced Configuration</u>
191
- ```
192
- input {
193
- syslog {
194
- port => 514
195
- }
196
- }
197
-
198
- output {
199
- microsoft-sentinel-log-analytics-logstash-output-plugin {
200
- client_app_Id => "${CLIENT_APP_ID}"
201
- client_app_secret => "${CLIENT_APP_SECRET}"
202
- tenant_id => "${TENANT_ID}"
203
- data_collection_endpoint => "${DATA_COLLECTION_ENDPOINT}"
204
- dcr_immutable_id => "${DCR_IMMUTABLE_ID}"
205
- dcr_stream_name => "Custom-MyTableRawData"
206
- key_names => ['PRI','TIME_TAG','HOSTNAME','MSG']
207
- }
208
- }
209
-
210
- ```
211
-
212
- Now you are able to run logstash with the example configuration and send mock data using the 'logger' command.
213
-
214
- For example:
215
- ```
216
- logger -p local4.warn --rfc3164 --tcp -t CEF "0|Microsoft|Device|cef-test|example|data|1|here is some more data for the example" -P 514 -d -n 127.0.0.1
217
- ```
218
-
219
- Which will produce this content in the sample file:
220
-
221
- ```
222
- [
223
- {
224
- "logsource": "logstashMachine",
225
- "facility": 20,
226
- "severity_label": "Warning",
227
- "severity": 4,
228
- "timestamp": "Apr 7 08:26:04",
229
- "program": "CEF:",
230
- "host": "127.0.0.1",
231
- "facility_label": "local4",
232
- "priority": 164,
233
- "message": "0|Microsoft|Device|cef-test|example|data|1|here is some more data for the example",
234
- "ls_timestamp": "2022-04-07T08:26:04.000Z",
235
- "ls_version": "1"
236
- }
237
- ]
238
- ```
239
-
240
-
241
- ## Known issues
242
-
243
- When using Logstash installed on a Docker image of Lite Ubuntu, the following warning may appear:
244
-
245
- ```
246
- java.lang.RuntimeException: getprotobyname_r failed
247
- ```
248
-
249
- To resolve it, use the following commands to install the *netbase* package within your Dockerfile:
250
- ```bash
251
- USER root
252
- RUN apt install netbase -y
253
- ```
254
- For more information, see [JNR regression in Logstash 7.17.0 (Docker)](https://github.com/elastic/logstash/issues/13703).
255
-
256
- If your environment's event rate is low considering the number of allocated Logstash workers, we recommend increasing the value of *plugin_flush_interval* to 60 or more. This change will allow each worker to batch more events before uploading to the Data Collection Endpoint (DCE). You can monitor the ingestion payload using [DCR metrics](https://learn.microsoft.com/azure/azure-monitor/essentials/data-collection-monitor#dcr-metrics).
257
- For more information on *plugin_flush_interval*, see the [Optional Configuration table](https://learn.microsoft.com/azure/sentinel/connect-logstash-data-connection-rules#optional-configuration) mentioned earlier.
258
-
1
+ # Microsoft Sentinel Output Plugin for Logstash
2
+
3
+ Microsoft Sentinel provides a new output plugin for Logstash. Use this output plugin to send any log via Logstash to the Microsoft Sentinel/Log Analytics workspace. This is done with the Log Analytics DCR-based API.
4
+ You may send logs to custom or standard tables.
5
+
6
+ Plugin version: v2.2.1
7
+ Released on: 2026-05-27
8
+
9
+ This plugin is currently in development and is free to use. We request and appreciate feedback from users.
10
+
11
+ ## Installation Instructions
12
+ 1) Install the plugin
13
+ 2) Create a sample file
14
+ 3) Create the required DCR-related resources
15
+ 4) Configure Logstash configuration file
16
+
17
+
18
+ ## 1. Install the plugin
19
+
20
+ Microsoft Sentinel provides Logstash output plugin to Log analytics workspace using DCR based logs API.
21
+
22
+ The plugin is published on [RubyGems](https://rubygems.org/gems/microsoft-sentinel-log-analytics-logstash-output-plugin). To install to an existing logstash installation, run `logstash-plugin install microsoft-sentinel-log-analytics-logstash-output-plugin`.
23
+
24
+ If you do not have a direct internet connection, you can install the plugin to another logstash installation, and then export and import a plugin bundle to the offline host. For more information, see [Logstash Offline Plugin Management instruction](<https://www.elastic.co/guide/en/logstash/current/offline-plugins.html>).
25
+
26
+ Microsoft Sentinel's Logstash output plugin supports the following versions
27
+ - 7.0 - 7.17.13
28
+ - 8.0 - 8.9 (NOTE: these versions require a security update, according to Logstash!)
29
+ - 8.11 - 8.15 (NOTE: these versions require a security update, according to Logstash!)
30
+ - 8.19.2 (NOTE: this version requires a security update, according to Logstash!)
31
+ - 9.0.8 (NOTE: this version requires a security update, according to Logstash!)
32
+ - 9.1.10 (NOTE: this version requires a security update, according to Logstash!)
33
+ - 9.2.4 - 9.2.5 (NOTE: these versions require a security update, according to Logstash! [Security Update](https://discuss.elastic.co/t/logstash-8-19-14-9-2-8-9-3-3-security-update-esa-2026-29/385816))
34
+ - 9.3.3
35
+
36
+ Please note that when using Logstash 8, it is recommended to disable ECS in the pipeline. For more information refer to [Logstash documentation.](<https://www.elastic.co/guide/en/logstash/8.4/ecs-ls.html>)
37
+
38
+ ## 2. Create a sample file
39
+ To create a sample file, follow the following steps:
40
+ 1) Copy the output plugin configuration below to your Logstash configuration file:
41
+ ```
42
+ output {
43
+ microsoft-sentinel-log-analytics-logstash-output-plugin {
44
+ create_sample_file => true
45
+ sample_file_path => "<enter the path to the file in which the sample data will be written>" #for example: "c:\\temp" (for windows) or "/var/log" for Linux.
46
+ }
47
+ }
48
+ ```
49
+ Note: make sure that the path exists before creating the sample file.
50
+ 2) Start Logstash. The plugin will collect up to 10 records to a sample.
51
+ 3) The file named "sampleFile<epoch seconds>.json" in the configured path will be created once there are 10 events to sample or when the Logstash process exited gracefully. (for example: "c:\temp\sampleFile1648453501.json").
52
+
53
+
54
+ ### Configurations:
55
+ The following parameters are optional and should be used to create a sample file.
56
+ - **create_sample_file** - Boolean, False by default. When enabled, up to 10 events will be written to a sample json file.
57
+ - **sample_file_path** - Number, Empty by default. Required when create_sample_file is enabled. Should include a valid path in which to place the sample file generated.
58
+
59
+ ### Complete example
60
+ 1. set the pipeline.conf with the following configuration:
61
+ ```
62
+ input {
63
+ generator {
64
+ lines => [ "This is a test log message"]
65
+ count => 10
66
+ }
67
+ }
68
+
69
+ output {
70
+ microsoft-sentinel-log-analytics-logstash-output-plugin {
71
+ create_sample_file => true
72
+ sample_file_path => "<enter the path to the file in which the sample data will be written>" #for example: "c:\\temp" (for windows) or "/var/log" for Linux.
73
+ }
74
+ }
75
+ ```
76
+
77
+ 2. the following sample file will be generated:
78
+ ```
79
+ [
80
+ {
81
+ "host": "logstashMachine",
82
+ "sequence": 0,
83
+ "message": "This is a test log message",
84
+ "ls_timestamp": "2022-10-29T13:19:28.116Z",
85
+ "ls_version": "1"
86
+ },
87
+ ...
88
+ ]
89
+ ```
90
+
91
+ ## 3. Create the required DCR-related resources
92
+ To configure Microsoft Sentinel Logstash plugin you first need to create the DCR-related resources. To create these resources, follow one of the following tutorials:
93
+ 1) To ingest the data to a custom table use [Tutorial - Send custom logs to Azure Monitor Logs (preview) - Azure Monitor | Microsoft Docs](<https://docs.microsoft.com/azure/azure-monitor/logs/tutorial-custom-logs>) tutorial. Note that as part of creating the table and the DCR you will need to provide the sample file that you've created in the previous section.
94
+ 2) To ingest the data to a standard table like Syslog or CommonSecurityLog use [Tutorial - Send custom logs to Azure Monitor Logs using resource manager templates - Azure Monitor | Microsoft Docs](<https://docs.microsoft.com/azure/azure-monitor/logs/tutorial-custom-logs-api>).
95
+
96
+ *Note:* The identity (service principal or managed identity) must have the **Monitoring Metrics Publisher** role on the target DCR:
97
+
98
+ ```
99
+ az role assignment create \
100
+ --assignee <object-id-of-identity> \
101
+ --role "Monitoring Metrics Publisher" \
102
+ --scope "/subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.Insights/dataCollectionRules/<dcr-name>"
103
+ ```
104
+
105
+
106
+ ## 4. Configure the Output Plugin
107
+
108
+ Add the `microsoft-sentinel-log-analytics-logstash-output-plugin` block to the `output` section of your Logstash configuration file (e.g., `logstash.conf`). The plugin requires three values from your Azure DCR resources plus authentication credentials depending on your method.
109
+
110
+ ### Required Config Values (needed for all methods)
111
+
112
+ | Key | Description |
113
+ |---|---|
114
+ | `data_collection_endpoint` | Your DCE logsIngestion URI |
115
+ | `dcr_id` | The immutable ID of your Data Collection Rule |
116
+ | `stream_name` | The stream name from your DCR (e.g., `Custom-MyTableRawData_CL`) |
117
+
118
+ ---
119
+
120
+ ### Authentication Examples
121
+
122
+ The plugin auto-detects the auth method based on which config values are present.
123
+
124
+ #### Option 1: Client Secret (App Registration)
125
+
126
+ Provide `client_id`, `client_secret`, and `tenant_id` for your Azure App Registration / service principal.
127
+
128
+ ```
129
+ output {
130
+ microsoft-sentinel-log-analytics-logstash-output-plugin {
131
+ data_collection_endpoint => "https://<your-dce-name>.<region>.ingest.monitor.azure.com"
132
+ dcr_id => "dcr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
133
+ stream_name => "Custom-MyTableRawData_CL"
134
+ client_id => "<your-app-client-id>"
135
+ client_secret => "<your-app-client-secret>"
136
+ tenant_id => "<your-azure-tenant-id>"
137
+ }
138
+ }
139
+ ```
140
+
141
+
142
+ #### Option 2: Managed Identity
143
+
144
+ When running on an Azure VM with a system-assigned managed identity, omit `client_id`, `client_secret`, and `tenant_id`. The plugin will automatically use the VM's managed identity.
145
+
146
+ ```
147
+ output {
148
+ microsoft-sentinel-log-analytics-logstash-output-plugin {
149
+ data_collection_endpoint => "https://<your-dce-name>.<region>.ingest.monitor.azure.com"
150
+ dcr_id => "dcr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
151
+ stream_name => "Custom-MyTableRawData_CL"
152
+ }
153
+ }
154
+ ```
155
+
156
+ #### Option 3: Client Secret + Sovereign Cloud
157
+
158
+ To authenticate against a sovereign cloud, add `azure_cloud`. Supported values: `AzurePublicCloud` (default), `AzureUSGovernment`, `AzureChinaCloud`, `AzureGermanyCloud`.
159
+
160
+ ```
161
+ output {
162
+ microsoft-sentinel-log-analytics-logstash-output-plugin {
163
+ data_collection_endpoint => "https://<your-dce-ingestion-endpoint>"
164
+ dcr_id => "dcr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
165
+ stream_name => "Custom-MyTableRawData_CL"
166
+ client_id => "<your-app-client-id>"
167
+ client_secret => "<your-app-client-secret>"
168
+ tenant_id => "<your-tenant-id>"
169
+ azure_cloud => "AzureUSGovernment"
170
+ }
171
+ }
172
+ ```
173
+
174
+ #### Option 4: Managed Identity + Sovereign Cloud
175
+
176
+ ```
177
+ output {
178
+ microsoft-sentinel-log-analytics-logstash-output-plugin {
179
+ data_collection_endpoint => "https://<your-dce-ingestion-endpoint>"
180
+ dcr_id => "dcr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
181
+ stream_name => "Custom-MyTableRawData_CL"
182
+ azure_cloud => "AzureUSGovernment"
183
+ }
184
+ }
185
+ ```
186
+ ---
187
+ Security notice: We recommend not to implicitly state client_id, client_secret, tenant_id, data_collection_endpoint, and dcr_id in your Logstash configuration for security reasons.
188
+ It is best to store this sensitive information in a Logstash KeyStore as described here- ['Secrets Keystore'](<https://www.elastic.co/guide/en/logstash/current/keystore.html>)
189
+
190
+ ---
191
+
192
+ ## Full Pipeline Example
193
+
194
+ A complete `logstash.conf` using client secret auth with a Beats input:
195
+
196
+ ```
197
+ input {
198
+ beats {
199
+ port => 5044
200
+ }
201
+ }
202
+
203
+ filter {
204
+ }
205
+
206
+ output {
207
+ microsoft-sentinel-log-analytics-logstash-output-plugin {
208
+ data_collection_endpoint => "https://my-dce.eastus2-1.ingest.monitor.azure.com"
209
+ dcr_id => "dcr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
210
+ stream_name => "Custom-MyTableRawData_CL"
211
+ client_id => "619c1731-15ca-4403-9c61-xxxxxxxxxxxx"
212
+ client_secret => "xxxxxxxxxxxxxxxx"
213
+ tenant_id => "72f988bf-86f1-41af-91ab-xxxxxxxxxxxx"
214
+ }
215
+ }
216
+ ```
217
+ ---
218
+
219
+ ## Optional Config Values
220
+
221
+ | Key | Default | Description |
222
+ |---|---|---|
223
+ | `azure_cloud` | `AzurePublicCloud` | Azure cloud environment |
224
+ | `keys_to_keep` | *(all)* | Array of field names to send (subset filtering) |
225
+ | `max_retries_num` | `3` | Max retry attempts for failed sends |
226
+ | `initial_wait_time_seconds` | `1` | Initial backoff between retries |
227
+ | `max_graceful_shutdown_time_seconds` | `60` | Max wait for graceful shutdown |
228
+ | `max_waiting_time_for_batch_seconds` | `10` | Max wait before flushing a batch |
229
+ | `max_waiting_for_unifier_time_seconds` | `10` | Max wait before flushing the unifier |
230
+ | `max_batch_size` | `10000` | Maximum number of events per batch. When a batch reaches this size it is flushed immediately, regardless of the time window |
231
+ | `input_queue_capacity` | `50000` | Maximum capacity of the input queue. Bounds memory usage under high-volume ingestion. When full, back-pressure is applied to the Logstash pipeline |
232
+ | `internal_queue_capacity` | `500` | Maximum capacity of the internal queues between batcher, unifier, and sender workers. Bounds memory usage for in-flight batches |
233
+ | `worker_sleep_time_millis` | `10` | Delay between worker iterations |
234
+ | `batcher_workers_count` | *(auto)* | Number of batcher threads |
235
+ | `sender_workers_count` | *(auto)* | Number of sender threads |
236
+ | `unifier_workers_count` | *(auto)* | Number of unifier threads |
237
+
238
+ ## Known issues
239
+
240
+ When using Logstash installed on a Docker image of Lite Ubuntu, the following warning may appear:
241
+
242
+ ```
243
+ java.lang.RuntimeException: getprotobyname_r failed
244
+ ```
245
+
246
+ To resolve it, use the following commands to install the *netbase* package within your Dockerfile:
247
+ ```
248
+ USER root
249
+ RUN apt install netbase -y
250
+ ```
251
+ For more information, see [JNR regression in Logstash 7.17.0 (Docker)](https://github.com/elastic/logstash/issues/13703).
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 2.2.1